+ Reply to Thread
Results 1 to 7 of 7

Lookup and then sum a range

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    7

    Lookup and then sum a range

    Im creating a spreadsheet that takes the year to date from the current year and compares it to the year to date from the same time last year (2013 v. 2012)

    Am attaching the watered down spreadsheet for just one person (the final will have more than 50 listed).

    I have been looking LOOKUP to find the current month stats but that year to date stat needw to be a sum of the range.

    So in the example I changed the date so the month of May is the target (D1) >>=DATE(YEAR(TODAY())-1,MONTH(TODAY())*5,1)

    I can get the value returned just for the month of May by using =LOOKUP, but what I need it to do is sum all totals from Jan through the month of May (B2:B6)
    (I am setting this up so as the computer date changes (D1), the range will change to include all months from January through the current month.

    Am somewhat a novice so stuck on which formula or how to write this, any help would be appreciated.

    Mick
    Attached Files Attached Files
    Last edited by themick; 01-09-2013 at 01:45 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Lookup and then sum a range

    see if this works for you...
    =SUMIFS($B$2:$B$13,$A$2:$A$13,"<="&D1,$A$2:$A$13,">="&A2)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Lookup and then sum a range

    Hi Mick,


    Use below formula:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    see attached:- Book1.xlsx


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  4. #4
    Registered User
    Join Date
    11-06-2012
    Location
    california
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Lookup and then sum a range

    Thank you both for your responses; both of these work when I copy/paste and test. The simpler thing to do would be to copy and continue but I like to understand the formulas that I use so i can effectively troubleshoot. thank you so much; have a nice eveing.

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Lookup and then sum a range

    you are welcome mick...

    suggest you to mark this thread as [SOLVED]..

    Regards,
    DILIPandey
    <click on below * if this helps>

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Lookup and then sum a range

    Mine is a very simple sumifS() function...
    =SUMIFS($B$2:$B$13,$A$2:$A$13,"<="&D1,$A$2:$A$13,">="&A2)
    the syntax is...
    =sumifs(sum-range, criteria1 range, criteria1,criteria2 range, criteria2....etc)
    so it says that sum all values in B2:B13, if the date in A2:A13 <= the date in D1, and if the date in A2:A13 greater than the date in A2 (1/1/13)

    Hope that helps?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Lookup and then sum a range

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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