+ Reply to Thread
Results 1 to 6 of 6

Formula to SUM for a Given Field Type Specified in another Column

  1. #1
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Question Formula to SUM for a Given Field Type Specified in another Column

    Hi All,

    I'm sure this will be a very simple one for someone - it leaves me *head scratching* though!
    I have attached a VERY generic example and it includes what I am trying to SUM for the given data.
    From the example if we look at Question Z1:
    "Total Cost of All types of "Lemons" " = ??
    I could simply do
    Please Login or Register  to view this content.
    , however this is a very simplistic spreadsheet for me to learn the formulae to apply to my spreadsheet that is MUCH bigger.

    I require the formula to:
    Sum the costs of all the Types of the Fruit, when the fruit is specified by "H4". I.e. if Column A if = to "Lemons" as specified by "H4", SUM the Relevant section of Column D.

    To move on further, e.g Question Z4, Sum the cost of all the Fruits as specified by "H4" that their 'Use' is equal to "I4", i.e. 'Lemons' to 'Eat'.

    I guess the above may require some IF statements and or VLOOKUP, I'm just not at all sure how to setup the formula to get the required outcome. Any help would be appreciated - Sorry for the long winded explanation!

    Cheers,
    Mark
    Attached Files Attached Files
    Last edited by R_S_6; 10-27-2009 at 06:40 AM.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Formula to SUM for a Given Field Type Specified in another Column

    Hi Mark,

    You can use SUMPRODUCT for this one
    Attached Files Attached Files
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Re: Formula to SUM for a Given Field Type Specified in another Column

    Oldchippy - Thanks for the reply. That seems a handy function!

    I feel I may have described the issue a little wrongly in the original post -

    I require formula to refer to a cell, in this case "H4" which is 'Lemons'. I then require the formula to search for 'Lemons' in Column A (it occupies rows 2-9), then sum the cost of all the types of Lemon (A-H). That would answer Question Z1.

    For Question Z8 for example.
    I require formula to refer to a cell, in this case "H5" which is 'Apples'. I then require the formula to search for 'Apples' in Column A (it occupies rows 10-17), then sum the cost of all the Apples that are Required as specified by Cell "J4", in this case 'Yes'. This would then provide the total cost of 'Apples' that are Required.

    I hope the above makes things a bit clearer...?
    I use the values in columns H-J to help specify the formula criteria; as to go through and highlight each block of 'Quantities for Lemons' the 'Cost of Lemons' for example would take a long time on my actual spreadsheet.

    Cheers

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: Formula to SUM for a Given Field Type Specified in another Column

    Hi,

    To do that you would need to reformat column A so that the type of fruit is in each row so for instance "Lemon" would appear in each cell A2:A9 then you can use this formula

    =SUMPRODUCT(--(A2:A9=H4),C2:C9,D2:D9)

    Adjust the others to the same format and you should be able to work it out

  5. #5
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Thumbs up Re: Formula to SUM for a Given Field Type Specified in another Column

    Thats great - I'll give that a go now! Thanks for your prompt and very useful replies!
    Cheers,
    Mark

  6. #6
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    142

    Smile Re: Formula to SUM for a Given Field Type Specified in another Column

    Works a Treat! Thanks Again!

+ 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