+ Reply to Thread
Results 1 to 4 of 4

Sumifs Formula using vlookup to chose which YTD calculation to use

  1. #1
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Sumifs Formula using vlookup to chose which YTD calculation to use

    I've got a spreadsheet with multiple years worth of sales data. I currently use a pivot table to gather the data for the current year and previous year so as to compare the two. On another spreadsheet I then do a vlookup on the pivot table based on the sales person's name. Every month I have to update all of my pivot tables to include the new month of data. I'm wanting to completely get rid of the pivot table version and go with something more like a Sumifs formula. This would make it much easier to maintain when going from one month to the next and one year to the next. I know I can do a =sum(sumifs...{"10","11","12"})) formula to sum months 10, 11 and 12. But I'm thinking what I might need (and I may be over thinking it) is to have a vlookup like this:

    Col A Col B
    Jan "1"
    Feb "1","2"
    Mar "1","2","3"....etc, etc

    then I could have a drop down list where I choose the month and it returns the value in column B as in the above example. However, apparently I can't use a vlookup within {}. I've attached my example. Any help is much appreciated!Sumifs Example.xlsx

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sumifs Formula using vlookup to chose which YTD calculation to use

    Hi,

    It's not clear to me why you wouldn't want a Pivot Table. You mention another field 'Sales Person's' name although that doesn't feature in the file you uploaded. However there's no reason why this field couldn't be included in a PT too.

    If you're concerned about updating the totals then the technique I always use to make this completely automatic is to create a dynamic range name for your data so that the name automatically expands its range as you add new data, and use the range name as the source range for your PT.

    Then I use a single line of code in the Sheet Activate event of the sheet that contains the pivot table, which refreshes the Pivot table cache every time you activate the PT sheet.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Re: Sumifs Formula using vlookup to chose which YTD calculation to use

    The reason I don't want to use a pivot table is because I have several pivot tables that summarize different data (sales people, product sold, key customers sold to, regions, etc). Usually they all have to be updated each month (but not always) and to do so all I do is update the pivot table to include the new month. It gets tedious updating each pivot table and it makes the file very large. I also don't like having a separate tab holding all of this information. I'd rather just build a formula directly in to my output worksheet. I'm pretty sure a Sumifs formula would do the trick. I just need a way of having the sumifs dynamically include the new month of data without me having to add to the formula each month.

  4. #4
    Forum Contributor
    Join Date
    04-27-2009
    Location
    Dallas, TX
    MS-Off Ver
    Office 365
    Posts
    215

    Re: Sumifs Formula using vlookup to chose which YTD calculation to use

    I just figured it out!

    =SUMIFS(C:C,A:A,"2014",B:B,">0",B:B,"<="&VLOOKUP(E11,$E$14:$G$25,3,FALSE))

    where ">0" will be static and the vlookup is based on the value returned when the month is selected in the drop down (ie, Sep =9) therefore values >=0 and <=9 are returned.

    Now I can just use this formula and it will update all cells automatically.

+ 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. Replies: 1
    Last Post: 08-12-2014, 01:37 AM
  2. [SOLVED] Vlookup & multiple sumifs formula question
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-27-2014, 07:42 PM
  3. Replies: 0
    Last Post: 02-21-2013, 09:53 AM
  4. SUMIFS and VLOOKUP combination across sheets; dragging formula
    By alillian in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-09-2012, 10:21 AM
  5. Combined vlookup and sumifs in a single formula
    By mrexcelrc1 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-27-2012, 04:54 PM

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