+ Reply to Thread
Results 1 to 7 of 7

If Match then SUM? - Wanting to add multiple values if criteria matches

  1. #1
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    If Match then SUM? - Wanting to add multiple values if criteria matches

    Column A would be Recipe Numbers, Column B the Planned Total.

    I want to search column A for all matching recipe numbers.
    Then, any recipes that match, look in column B for the planned totals, adding all incidents where they match.

    Then the most difficult part, which just occured to me now... I only need the Total Planned Total and Recipe name reported once...

    Recipe#..........Planned Total
    450................100
    600................75
    620................125
    450................50
    620................180
    450................100
    600................200
    450................110

    I will not be able to sort these lists.

    If-Match-Sum? to display:
    Recipe#............Total Planned Total
    450....................360
    600....................275
    620....................305


    I've researched for the first part... and it seems like Match will only find the first match and not look further? Am I wrong on this?
    How to display the results hadn't even occured to me yet, since I was still trying to figure out how to GET the result.

    Thank you!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    Hi,

    Something along the lines of

    =SUMIF(A2:A9,"=450",B2:B9)
    =SUMIF(A2:A9,"=600",B2:B9)
    =SUMIF(A2:A9,"=620",B2:B9)
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    You need Sumif()

    e.g. =Sumif($A$1:$A$10,X1,$B$1:$B$10)

    where A1:A10 contain the database and X1 is the recipe number to sum
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    There are approximately 900 Recipe numbers. On any given day, about 30 random numbers will be used.

    Actually, they won't be random. It's a planned menu....

    Thinking, please wait....

    Okay... Column A will be referenced from the worksheet where the information is entered. So the information won't be totally random, but it will change on a daily basis. There is a full recipe index on another worksheet.

    Bah... I'm not sure if I'm even coherent.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    To index items on another sheet...something like:

    =Sumif('Recipes'!$A$1:$A$10,X1,'Recipes'$B$1:$B$10)

    where Recipes is the sheet containing the main database and X1 on your current sheet contains the recipe number you want summed from the Recipes! database.

    If that is not what you are after, post a sample worksheet showing what you need

  6. #6
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    I'll do that shortly... The rest of the workbook was only theory and chicken scratch on paper. I was trying to get a good outline going before I dove into the whole project.
    I'm building it all now.

  7. #7
    Registered User
    Join Date
    12-19-2008
    Location
    CA
    Posts
    64

    Re: If Match then SUM? - Wanting to add multiple values if criteria matches

    This SUMIF did work... spawned a secondary question once I got all of it together, but that is for another thread I think.
    It was the too many recipe numbers that had me confused. The X1 part of the formula, referring back to the number in column A of the same row... that was the "KEY" I was missing.

    Please Login or Register  to view this content.
    Thank you 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)

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