+ Reply to Thread
Results 1 to 9 of 9

SUM and LOOKUP Formula that changes with references

  1. #1
    Registered User
    Join Date
    03-23-2017
    Location
    Jacksonville, FL
    MS-Off Ver
    2013
    Posts
    10

    SUM and LOOKUP Formula that changes with references

    Good afternoon. I'm stumped on trying to setup a formula that moves with a changing reference and multiple criteria. For example, I have a file that measures labor productivity by pay periods, which I have numbered, and locations. I'm using a drop down for Period numbers and want to use that as a static reference for a lookup. For instance, if I choose Pay Period 10, I want it to include Pay Period 10 and the preceding 9 periods to sum up. When Pay Period 11 hits, I want to be able to change the drop down to Pay Period 11 and have the formula automatically sum that pay period and the preceding 9. I was trying different iterations of SUMIFS, MATCH and OFFSET. Nothing seems to work.

    I hope that makes sense.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: SUM and LOOKUP Formula that changes with references

    You can do it with SUM(INDEX(...):INDEX(...)), but it is difficult to be more specific as you have given no details about how your data is laid out (cells/columns used etc.)

    It would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and then on Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Please note that the Paperclip icon does not work.

    Hope this helps.

    Pete

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: SUM and LOOKUP Formula that changes with references

    Not much!!!

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    03-23-2017
    Location
    Jacksonville, FL
    MS-Off Ver
    2013
    Posts
    10

    Re: SUM and LOOKUP Formula that changes with references

    Thank you Pete. I have attached a sample file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-23-2017
    Location
    Jacksonville, FL
    MS-Off Ver
    2013
    Posts
    10

    Re: SUM and LOOKUP Formula that changes with references

    You will see a drop down in cell B4. Basically, what I'm trying to do is, calculate the sum of 10 pay periods based on the date chosen in the drop down and have it change with a new selection when I change the date in the drop down.

    For example, if I choose 2017-6, I want it to include that pay period and the preceding 9. If I choose 2017-5, I want it to include that pay period and the preceding 9.
    Last edited by tbfla; 03-23-2017 at 01:02 PM.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: SUM and LOOKUP Formula that changes with references

    You can put this formula in cell BJ6:

    =SUM(INDEX($C6:$BH6,MATCH($B$4,$C$5:$BH$5,0)-9):INDEX($C6:$BH6,MATCH($B$4,$C$5:$BH$5,0)))

    then copy down. For the 20 pay periods you just need to change the -9 to -19.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    03-23-2017
    Location
    Jacksonville, FL
    MS-Off Ver
    2013
    Posts
    10

    Re: SUM and LOOKUP Formula that changes with references

    Fantastic!!!!!!!!!!!! Thank you Pete!!!!!!!!!!!!!!!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: SUM and LOOKUP Formula that changes with references

    You're welcome - glad to help.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  9. #9
    Registered User
    Join Date
    03-23-2017
    Location
    Jacksonville, FL
    MS-Off Ver
    2013
    Posts
    10

    Re: SUM and LOOKUP Formula that changes with references

    Done and done. That worked Pete. Thanks for your help!

+ 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. Lookup References
    By SirDraco in forum Excel General
    Replies: 2
    Last Post: 02-09-2015, 09:05 AM
  2. Lookup 2 rows with 2 references
    By smith_ts in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-25-2012, 07:33 AM
  3. Dissecting a formula string into references/non-references
    By quekbc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-06-2011, 10:52 AM
  4. Lookup two references and sum total
    By JSB0009 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2010, 11:31 PM
  5. lookup references
    By brp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2007, 05:38 AM
  6. References And Lookup
    By JR573PUTT in forum Excel General
    Replies: 2
    Last Post: 03-31-2006, 01:53 AM
  7. [SOLVED] How to change lookup references
    By Guy Yeakley in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2006, 10:30 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