+ Reply to Thread
Results 1 to 10 of 10

Lookup formulas for month and YTD

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Lookup formulas for month and YTD

    Hello. I want to create a lookup formula that will return monthly values and YTD values from another sheet in a workbook. I've attached a workbook with two worksheets.
    Attached Files Attached Files

  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 formulas for month and YTD

    1st, I suggest you use real dates, instead of month name/year, it will make the calcs much easier
    2nd, make sure your names mact across sheets. Sheet1 uses "Sales 1" (with a space), but sheet 2 uses "Sales2" No space

    2nd, assuming you now have real dates, starting 3/1/14 to 12/1/14...
    for the month
    =INDEX(Sheet1!$F$3:$O$5,MATCH(Sheet2!$B4,Sheet1!$C$3:$C$5,0),MATCH(Sheet2!C$3,Sheet1!$F$2:$O$2,0))

    For the year, something like...
    =SUMIFS(Sheet1!$F3:$O3,Sheet1!$F$2:$O$2,">="&Sheet2!C$3,Sheet1!$F$2:$O$2,"<="&Sheet2!D$3)
    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 Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Lookup formulas for month and YTD

    Thanks. Why are you starting from F3? I'm getting an error.

  4. #4
    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 formulas for month and YTD

    I assumed that was where your data started. If you only start from Sales 2, then change the range to F4. That is just to indicate the top-left corner of your data range.

    I also got an error, until I entered Sales 1 in C3 (figured you had forgotten to enter it)

  5. #5
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Lookup formulas for month and YTD

    I figured out how to modify your first formula for the month, but I have no idea what you are doing with the sumif formula. THe references are all off I think.

  6. #6
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Lookup formulas for month and YTD

    This is how I tried to redo your second formula but it didn't work. =SUMIFS(Sheet1!$D3:$O3,Sheet1!$D$2:$O$2,">="&Sheet2!C$3,Sheet1!$D$2:$D$2,"<="&Sheet2!D$3)

  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 formulas for month and YTD

    No, the references for the SUMIFS were not off, they were based on teh rows on both sheets being in the same sequence.

    Perhaps this would be better....
    =SUMPRODUCT(--(Sheet1!$F$2:$O$2>=Sheet2!C$3)*(Sheet1!$F$2:$O$2<=Sheet2!D$3)*(Sheet1!$C$3:$C$5=Sheet2!$B4)*(Sheet1!$F$3:$O$5))

  8. #8
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Lookup formulas for month and YTD

    Never mind. Figured it out. Thanks.

  9. #9
    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 formulas for month and YTD

    Glad you got it resolved, thanks for the rep

  10. #10
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    Re: Lookup formulas for month and YTD

    Hey Mr. Dibbins. I realized that this formula isn't dynamic. SUMIFS(Sheet1!$D3:$O3,Sheet1!$D$2:$O$2,">="&Sheet2!C$3,Sheet1!$D$2:$O$2,"<="&Sheet2!D$3)
    I'm using it for another sheet and if I want to drag it down it doesn't work because the rows refer to different rows in the data sheet. This one just refers to the next row.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change date in excel formulas from month to month automatically
    By ANDREAAS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-02-2013, 09:34 AM
  2. Replies: 5
    Last Post: 09-25-2013, 02:51 PM
  3. [SOLVED] Lookup month and calculate if specific month value apply
    By D-smoke in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-24-2013, 03:03 AM
  4. TEXT & MONTH Formulas returning wrong Month
    By dwoodrocksyourb in forum Excel General
    Replies: 2
    Last Post: 10-07-2010, 10:52 AM
  5. Moving formulas from month to month
    By kurmugon in forum Excel - New Users/Basics
    Replies: 16
    Last Post: 02-08-2007, 05:24 AM

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