+ Reply to Thread
Results 1 to 3 of 3

Vary range in sumif formula

Hybrid View

  1. #1
    Registered User
    Join Date
    10-08-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2007
    Posts
    12

    Vary range in sumif formula

    Hi,

    How can I change the range that is summed in a sumifs formula based on the entry in another cell. For example, if a user selected Prod A in cell A1, the sumifs would sum column M. If product B was selected, the sumifs would sum column N. If product C was selected it would sum column Q.

    I know I can do this using a lot of 'if' statements but there are too many products for this to be done realistically. The first part of the sumifs formula is the same for all, I just need to change the range summed.

    Thanks in advance for any help.

  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,424

    Re: Vary range in sumif formula

    If you have a table somewhere which lists the products in one column and the column letter(s) where the data can be found in the next column, then you can use a VLOOKUP function to return the appropriate letter(s), and then you can make use of INDIRECT to give you the appropriate range for your SUMIFS function.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-08-2012
    Location
    Leeds
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Vary range in sumif formula

    Ah yes, that makes sense and is relatively straightforward. Many thanks!

+ 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