+ Reply to Thread
Results 1 to 7 of 7

Summing a v lookup

  1. #1
    Registered User
    Join Date
    10-05-2006
    Posts
    34

    Summing a v lookup

    how can i detect a date range in a column then sum the values in another column? thanks in advance for the help.



    the table looks like
    11/24/06 100
    11/24/06 200
    11/24/06 3000
    11/24/06
    11/24/06
    11/25/06 100

    how can i get a sum for the 24th to give me 3300 ???????
    Last edited by cjohnsen; 10-05-2006 at 04:14 PM.

  2. #2
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193
    Here ya go! Just copy and paste.

    NOTE: This assumes that the dates are located in column A, starting at row 1. If the dates are located elsewhere, simply change the col and row variables to reflect that.

    Please Login or Register  to view this content.
    Enjoy!
    Last edited by starryknight64; 10-05-2006 at 05:41 PM.
    starryknight64

  3. #3
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    Quote Originally Posted by cjohnsen
    how can i get a sum for the 24th to give me 3300 ???????
    Another way is this.

    Assuming your dates are in A1:A10 and your values are in B1:B10
    Then use the following as an array formula.

    =SUM(IF(A1:A10=DATE(2006,1,1),B1:B10,0))

    Copy the formula into a cell, then press Ctrl+Shft+Enter. This will create an array formula and Excel will automatically add {} braces around the formula. If you just press enter, it wont work. For a good read about array formulas, have a look at this site http://www.cpearson.com/excel/array.htm

  4. #4
    Registered User
    Join Date
    10-05-2006
    Posts
    34

    wait

    this is great thank you so much for your help. i was able to get the formula to work the only thing is this sums the entire column B if the one date is correct. i would only need this to sum the values that correspond to that date.... any more suggestions would be greatly appreciated!!



    =SUM(IF(A1:A10=DATE(2006,1,1),B1:B10,0))



    how can i attach a file for further help?


    i need to have a by day list of dates
    8/24/06 5100
    8/25/06 3000
    8/26/06
    8/27/06
    8/28/06

    that pulls from a bigger list of dates
    8/24/06 100
    8/24/06 5000
    8/25/06 1000
    8/25/06 2000
    ect...
    and sums the values in a different column but the same row.......
    Last edited by cjohnsen; 10-05-2006 at 05:33 PM.

  5. #5
    Forum Contributor starryknight64's Avatar
    Join Date
    09-27-2006
    Location
    Missouri
    MS-Off Ver
    2003 (Work) & 2007 (Home)
    Posts
    193
    Try my code, it does exactly as you specified. Just plug in starting row and column and you're golden.

    However, to fix up =SUM(IF(A1:A10=DATE(2006,1,1),B1:B10,0)), simply change the date to what you need, as well as the A1:A10. But the range summed (B1:B10)will need to be fixed to the range of like dates. You'll have to do this for each date.

    That, unfortunately, is the downside to excel programming (non-macro). You don't always get exactly what you want.
    Last edited by starryknight64; 10-05-2006 at 05:41 PM.

  6. #6
    Registered User
    Join Date
    06-13-2006
    Posts
    5

    array function

    =SUM(IF(DAY(A1:A6)=24,B1:B6,0)),Then Ctrl+Alt+Enter

  7. #7
    Registered User
    Join Date
    10-05-2006
    Posts
    34

    Thumbs up Thank You!

    this is great thank you!

    =SUM(IF(A1:A10=DATE(2006,1,1),B1:B10,0)),

    senerio:
    i upload a sheet from a vendor daily and need to not change anything but the date for each formula. the thing is, i get mostly the same data each day but occasionally i there will be an extra entry for weeks past and literally that messes up my entire sheet. i find myself going back and changing cell references daily and this is a very time consuming task.....

    if i could have each date search through the column of multiple and redundant dates for its corresponding date then total the value in the next column that would save me!!!

    how can i input your code ??? where does that fit in?


    thank you so much for your help this site is great!

+ 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