+ Reply to Thread
Results 1 to 12 of 12

Sum numeric values with different units

  1. #1
    Registered User
    Join Date
    04-22-2016
    Location
    Hong Long
    MS-Off Ver
    2008
    Posts
    10

    Sum numeric values with different units

    Hi Folks,

    I wanted to have write a formula to sum up the item with specific unit and the expected set out is like that:

    ITEM 1 10 PKT
    ITEM 2 11 KG
    ITEM 3 3 CTR
    ITEM 4 5 KG
    ITEM 5 30 KG
    ITEM 6 5 PKT

    Total PKT 15
    Total KG 46
    Total CTR 3

    I tried with this formula:
    =SUMPRODUCT(--(0&SUBSTITUTE(B3:B25, " PKT", "")))
    but it shows ‘#value!”

    Thank you

    Ref.

  2. #2
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Sum numeric values with different units

    With unit in C and value in B:
    =SUMIF(C2:C7,"PKT",B2:B7)

  3. #3
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Sum numeric values with different units

    Hi Can you share your excel sheet??
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Registered User
    Join Date
    04-22-2016
    Location
    Hong Long
    MS-Off Ver
    2008
    Posts
    10

    Re: Sum numeric values with different units

    Quote Originally Posted by shukla.ankur281190 View Post
    Hi Can you share your excel sheet??
    I am sorry for the format changed a bit
    Attached Files Attached Files

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum numeric values with different units

    Try array entering this formula in B10 and filling down and across to E12.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    This could be much simpler if your amounts and units were in separate columns. You could use the much more efficient SUMIF function. It would save you the trouble of splitting the data as I have done in the above ... and by the way this formula will not work if any amounts in rows 3:8 are greater than 99.
    Dave

  6. #6
    Registered User
    Join Date
    04-22-2016
    Location
    Hong Long
    MS-Off Ver
    2008
    Posts
    10

    Re: Sum numeric values with different units

    Thanks Dave !

    You are amazing !
    That worked just fine !!!

    Regards,
    Ref.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum numeric values with different units

    You're welcome.

    I had an afterthought.

    This formula does not require Ctrl + Shift + Enter. Commit with simply Enter. It also overcomes the 99 limitation.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-22-2016
    Location
    Hong Long
    MS-Off Ver
    2008
    Posts
    10

    Re: Sum numeric values with different units

    But I just encountered a problem when the cells empty.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum numeric values with different units

    Try array entering this in B10. Fill down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-22-2016
    Location
    Hong Long
    MS-Off Ver
    2008
    Posts
    10

    Re: Sum numeric values with different units

    Dave,

    You are Brilliant!
    It works perfectly now !!

    Regards,
    Ref.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Sum numeric values with different units

    Glad to hear it. Thanks for the feedback.

  12. #12
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: Sum numeric values with different units

    You can try this CSE formula:

    In B10 then fill down and across.
    =SUM(IFERROR(--SUBSTITUTE(B$3:B$7,RIGHT($A10,3),""),0))

+ 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. Replies: 9
    Last Post: 11-18-2013, 07:40 AM
  2. [SOLVED] vba macros to force user to input numeric values for numeric values with hyphen
    By Abdur_rahman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2013, 01:05 PM
  3. [SOLVED] UDF to Vlookup multiple delimited values (numeric/non-numeric) and sum found values
    By Geert Rottiers in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2013, 09:30 AM
  4. [SOLVED] Help find MAX value in one column when numeric & alph-numeric values are present
    By KevinAB in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-01-2013, 11:29 AM
  5. [SOLVED] Sum of numeric values within cells also containing non-numeric characters
    By Mike Brewer in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-24-2013, 09:16 AM
  6. [SOLVED] Calculate the Bonus units according to the quantity of the units bought (Help)
    By mo_naf in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-15-2012, 05:51 PM
  7. Extracting Numeric Values from an Alpha/Numeric String
    By Delkath in forum Excel General
    Replies: 5
    Last Post: 10-27-2010, 02:36 PM
  8. Sum numeric values that include units
    By T9PMK in forum Excel General
    Replies: 12
    Last Post: 10-26-2009, 05:55 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