+ Reply to Thread
Results 1 to 4 of 4

SUMIF statement

Hybrid View

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    california
    MS-Off Ver
    Excel 2007
    Posts
    2

    SUMIF statement

    Hi,

    So I have a data sheet where one column has numbers, second column has dates.

    The second column has dates on only some of the columns.

    For example:


    Column 1
    16
    12
    5
    -7
    10
    -5


    Column 2
    4/1/2012
    (empty)
    (empty)

    7/17/2012
    (empty)
    8/4/2012


    What I'm trying to do is use a SUMIF statement to add up the numbers for each date up to the next date listed.

    So the result on column 3 should look like

    33
    (empty)
    (empty)

    3
    (empty)
    -5



    Is there a way to do this with one formula? I need to use this formula on many cells and would like to keep a running formula to sum any numbers until the next date listed.

    Thanks for your time!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: SUMIF statement

    Why not fill the missing dates in column 2? An easy way is to highlight column 2, then press F5 (GoTo), then click Special, and then click Blanks. Then begin to enter a formula by typing = then click in the cell above the first highlighted cell (i.e. B1 in your example) and then hold down the CTRL key and press Enter. Then you can enter this formula in C1:

    =IF(C1=C2,"",SUMIF(B:B,B2,A:A))

    then copy down. Your subtotals will appear on the bottom row of any blocks with the same date.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    california
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: SUMIF statement

    Thank you Pete

    unfortunately though, the dates add confusion to the excel sheet. I'm trying to build this excel sheet as a way to quickly glimpse at the sheets and find what you need.

    Is there any other way to sum the numbers up without adding the dates to each row?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: SUMIF statement

    Well, it's a lot easier with them in, as you can see from the formula. Perhaps you could use another column which is filled with dates and hide this so your sheet would look the same, but use the hidden column for the SUMIF condition.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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