+ Reply to Thread
Results 1 to 5 of 5

Show individual values in a SumIf formula

  1. #1
    Registered User
    Join Date
    10-22-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    7

    Show individual values in a SumIf formula

    Hello,

    I need to find a way to show the cell values that are being used in a SUMIF formula. For example, let's say I have a 5 in cell A1 and a 2 in A2. I write a SUMIF in cell A5 that adds up all the numbers greater than 0 in my range of A1:A2. What I want this macro to do is show "=5+2" in the next column (B5). My macro skills are not sufficient to even know where to start, but I sure would be grateful if someone could help me out with this.

    The ideal macro would allow me to select several SUMIF functions and perform this task for everything I have selected.

    This will be used to consolidate financial statements but allow another user to see which values are being used. I have a a few hundred rows of data and I'm going to code each row to one of 20 general categories - Repairs & Maintenance or Miscellaneous Income, for example.

    Thank you!

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Show individual values in a SumIf formula

    b5: =if(and(a1>0,a2>0),a1 & " + " & a2)

    a5: =sumif(a1:a2,">0")

  3. #3
    Registered User
    Join Date
    10-22-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Show individual values in a SumIf formula

    I appreciate the reply, but that is not what I'm looking for. While that does accomplish getting a cell to say "5+2", I can't copy that into another sheet and have someone else (an auditor) see all the numbers that went into the calculation. Additionally, I have about 975 rows of data and this method would require me to write some extremely long IF statements. I'm looking for a macro that will identify the numbers being summed in my sumif statements, then show the actual math being done in a way that I can copy into another sheet and it would show =5+2 (in the real world scenario, there would be many more cells being added together). Thanks!

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Show individual values in a SumIf formula

    The best way to help you would be a non-sensitive sample in excel

  5. #5
    Registered User
    Join Date
    10-22-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Show individual values in a SumIf formula

    Good idea. Here is a doctored version which should show clearly enough what I'm trying to do. Thank you.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1