+ Reply to Thread
Results 1 to 6 of 6

Sumif where various conditions need to be met

  1. #1
    Registered User
    Join Date
    02-12-2013
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Sumif where various conditions need to be met

    I would like to identify how to use one formula in spreadsheet 3 that adds the values from Spreadsheet 1 according to all the codes that fall within a specific category (listed in spreadsheet 2)
    For example to find the total for the category Dogs there are 2 codes 2010 and 7480 and then both of these codes are in spreadsheet 1 with values of £20 and £1050.98 totaling £1070.98.

    Spreadsheet1

    Col A (list of 4 digit codes) Col B (Amount)
    2010 20.00
    4329 50.43
    7480 1050.98


    Spreadsheet 2

    Col A (list of 4 digit codes) Col B (Category Heading)
    2010 Dogs
    4329 Cats
    7480 Dogs

    Spreadsheet 3

    Col A (Category Heading) Col B
    Dogs
    Cats
    Hamsters

    I do hope that this is possible and that more importantly someone understands my explanation.

    Many thanks

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Sumif where various conditions need to be met

    in Sheet3!B1
    =SUMPRODUCT((Sheet2!B$1:B$3=A1)*(Sheet1!A$1:A$3=Sheet2!A$1:A$3)*(Sheet1!B$1:B$3))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-12-2013
    Location
    Oxford, England
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Sumif where various conditions need to be met

    Thank you unfortunately I am getting a #value error

    Do the columns with codes need to "numbers" or are they ok formatted as text.

    In spreadsheet 1 there are some blanks cells in the list of codes does this matter?

    other than that I am struggling to find anything that could be causing the problem.

    Any suggestions?

    Many thanks

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Sumif where various conditions need to be met

    Blanks may cause a problem if thery're in the middle of numeric data.
    SUMPRODUCT doesn't like text in the middle of numbers, all data should be numbers.

    I thought it was gonna go this way.
    It didn't look like your example data was a proper representation of your actual data so i thought there might be some hiccup.

    Based on your example data:
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Sumif where various conditions need to be met

    Can you post the file? Desensitise if it necessary.

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: Sumif where various conditions need to be met

    I think the below will work

    =SUMIFS(Sheet1!$B$1:$B$3,Sheet1!$A$1:$A$3,INDEX(Sheet2!$A$1:$A$3,MATCH($A1,Sheet2!$B$1:$B$3,0)))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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. sumif conditions
    By sateesh konduru in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-21-2013, 04:16 AM
  2. Sumif with 2 conditions
    By Rabinow81 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-09-2012, 10:23 AM
  3. Sumif with conditions?
    By WHWALDREP in forum Excel General
    Replies: 1
    Last Post: 12-06-2009, 11:15 AM
  4. SUMIF with 2 conditions
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-06-2005, 05:05 PM
  5. SUMIF with 2 conditions
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  6. SUMIF with 2 conditions
    By Simon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. SUMIF with 2 conditions
    By Simon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. [SOLVED] SUMIF with 2 conditions
    By Simon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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