+ Reply to Thread
Results 1 to 8 of 8

need to add all the same products but don`t know what formula to use

  1. #1
    Forum Contributor
    Join Date
    07-26-2017
    Location
    west midlands
    MS-Off Ver
    365
    Posts
    182

    need to add all the same products but don`t know what formula to use

    Hi Guys,
    Just me again trying to work out how to add all the products on my spreadsheet, eg. how many apples do I have in total.
    Please see attached SS and you will see what I am after.
    Maybe it`s a index/match formula, I would be really grateful if someone can put the formulas in and post it back.

    Thanks in advance,
    Tony
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: need to add all the same products but don`t know what formula to use

    I think this should do it, as long as there aren't any numbers as product codes.
    Put this in K2, then drag down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (You'll get double results for apples and pears, but I guess that won't be an issue with your real data.)

    Edit: the Offset isn't needed:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Refer also to my post below (post 5)



    If you do have number-only product codes, you may need to fall back on adding multiple SUMIFs together:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Hope that helps.
    Last edited by Aardigspook; 06-19-2019 at 04:21 PM. Reason: Note amended formula in post below
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Forum Contributor
    Join Date
    07-26-2017
    Location
    west midlands
    MS-Off Ver
    365
    Posts
    182

    Re: need to add all the same products but don`t know what formula to use

    Hi Aardigspook,
    This works fine - thankyou so much for your help. Would I be able to extend this if I want to add more columns..
    Wish I knew how this formula works

    Thanks again Aardigspook for your help.

  4. #4
    Registered User
    Join Date
    06-14-2019
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Office 365
    Posts
    20

    Re: need to add all the same products but don`t know what formula to use

    Does the table need to be structured this way? If you have the freedom to change the layout, I would recommend using a cross tab layout of Codes on the rows, and Locations on the Columns, it would be a lot easier to analyze and report on this data.
    Attachment 628958

  5. #5
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: need to add all the same products but don`t know what formula to use

    Yes, you can extend to use more columns. You can just change the last column number (currently 8), so that this part [Column2]:[Column8] becomes [Column2]:[Column12] or whatever you need.

    The way it works is this:
    SUMIF ( the range you want to check the criteria against , your criteria , the range you want to sum )
    Your criteria are in column K, starting with K2.
    The range you want to check those against are in columns A, C, E, G - columns 1 to 7 of the Table.
    The ranges you want to sum are in cols B, D, F, H - columns 2 to 8 of the Table.


    Because your criteria (products) are not numbers, when the formula tries to look up K2 in a column with numbers in it, it fails (invisibly) so just moves on). If you had a product which was a number, the formula might count the 'product number' as a quantity (depending on what all the numbers in the Table are) so that's why this shouldn't be used with Products which are numbers only. Hope that isn't too confusing!


    The Offset in my first formula isn't actually needed (sorry - it was a left over from something much more complicated I was trying first, for some reason). This will work just as well:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The two ranges include everything in all the specified columns: 1-7 and 2-8.
    If you want to extend this, just increment both Column7 and Column8, so they become Column11 and Column12, or whatever you need.


    However, if you have a lot more information, then it would be better to change the table structure first, as suggested by izzy-a above. I can't download the attachment in post-4 (I get an error), so I've done my own suggestion - see the attached file. You can either arrange the Products in rows and Locations in columns, or vice-versa. As you want to count the Products, I suggest the latter, as you can then use the 'Totals Row' option of the Excel Table to give you totals automatically. I've included all the different options on the sheet so you can see what I mean.

    Hope that helps.
    Last edited by Aardigspook; 06-19-2019 at 04:19 PM. Reason: Add colour to highlight part of formula

  6. #6
    Forum Contributor
    Join Date
    07-26-2017
    Location
    west midlands
    MS-Off Ver
    365
    Posts
    182

    Re: need to add all the same products but don`t know what formula to use

    Hi Aardigspook,
    Thanks for your example, will try this tomorrow at work. Also thanks for your explanation to the formula.

    Best regards,
    Tony

  7. #7
    Forum Contributor
    Join Date
    07-26-2017
    Location
    west midlands
    MS-Off Ver
    365
    Posts
    182

    Re: need to add all the same products but don`t know what formula to use

    Hi Aardigspook,
    Worked perfectly - thanks a million for your help

    Best regards,
    Tony

  8. #8
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: need to add all the same products but don`t know what formula to use

    You're welcome, glad I could 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. Formula to match products
    By GTN in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-21-2016, 11:12 AM
  2. New formula for old products
    By lcartwright in forum Excel General
    Replies: 1
    Last Post: 07-27-2016, 02:44 AM
  3. Replies: 8
    Last Post: 07-01-2016, 02:07 AM
  4. Replies: 6
    Last Post: 03-05-2016, 02:42 PM
  5. [SOLVED] sum products formula truncates
    By mmccra2858 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-01-2014, 09:25 AM
  6. Formula to work out how many products among various products!
    By MissConfussed in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-02-2013, 02:24 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