+ Reply to Thread
Results 1 to 3 of 3

Looking for the correct formula or function

  1. #1
    Registered User
    Join Date
    06-29-2016
    Location
    Montreal
    MS-Off Ver
    2016
    Posts
    4

    Looking for the correct formula or function

    Hi,

    Within a range of data, I have item numbers, some of which are duplicate (items sold in different weeks). Within the same range, I also have units sold. I'm trying to find a formula that will extract all units sold for each individual items number including duplicates.

    Example:

    Cell A2 Item # 1234 Units Sold 1
    Cell A3 Item # 1234 Units Sold 7
    Cell A4 Item # 2345 Units Sold 3...

    Item # 1234 should populate 8 units, I was using a Vlookup, but it's not working. The formula is simply returning 1 units, it's not finding the other 7 units. I'm positive that I'm using the wrong formula. Can anyone help?

    Thanks,

    Tresix

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Looking for the correct formula or function

    One way:
    With quantities in column B and item number in column A
    =SUMIF(A:A,"1234",B:B) [Text]
    =SUMIF(A:A,1234,B:B) [Numeric]

    look in column A for all cells ="1234" and sum the quantities found in column B
    Instead of 1234, you can use a cell reference

    Note - the 2 ranges must be identical in size
    Last edited by kev_; 07-07-2017 at 06:56 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    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: Looking for the correct formula or function

    Assuming you want to have a list of the different item numbers, with their totals, try this:
    Put this in D2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    It's an array formula, so enter using Ctrl-Shift-Enter not just enter. You should see curly brackets {} appear round the formula in the formula bar - don't try to enter them yourself.
    Drag it down as far as you need.
    Change the range $A$2:$A$10 to match your actual data. If you want to put this in another column than D, just change the $D$1:D1 range to that column.

    Then in E2, use this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Change both D2 instances if you've put the previous formula in another column (I think that's obvious, but...).


    Having said all of that, the easiest way to do this might be to use a pivot table instead.

    Select your range (A1:B10 or whatever - include your header row). On the 'Insert' tab on the ribbon, click 'Pivot Table'. You can choose to put it on the same worksheet or a new one. When you've created it, look on the right hand side and you'll see your column names as 'Fields'. Drag the 'Item number' into the 'Row labels' box below, then drag the 'Units sold' into the 'Values' box. The pivot table will then show you the totals, without you having to do anything else.


    The attached file shows both methods (formulae and pivot table).
    Hope that helps.
    Attached Files Attached Files
    Last edited by Aardigspook; 07-07-2017 at 07:15 PM. Reason: Add note about changing refs if diff column used
    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.

+ 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 not returning correct result using MODE() function
    By jackmcguigan1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2016, 01:15 PM
  2. Stuck on correct function(s) & formula!
    By minorcatherine1 in forum Excel Formulas & Functions
    Replies: 47
    Last Post: 09-28-2016, 04:02 AM
  3. Replies: 2
    Last Post: 05-30-2013, 06:08 PM
  4. Indirect function formula not correct
    By trobie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-12-2013, 08:30 AM
  5. [SOLVED] VLOOKUP Issue - formula correct in function box but not in spreadsheet
    By jlowes in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-25-2012, 12:55 PM
  6. function to check names within formula are correct
    By Macatk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-18-2009, 08:59 PM
  7. Correct VBA syntax for cell function formula
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 01:05 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