+ Reply to Thread
Results 1 to 4 of 4

Sort cells by first 4 alphabets and Sum

  1. #1
    Registered User
    Join Date
    03-11-2008
    Posts
    27

    Sort cells by first 4 alphabets and Sum

    Hi All,

    I have a whole bunch of item numbers in Column A with corresponding quantity in column B. some items in column A are like the ones I attached (with size ends). But these items (eg. ABCD01, 02-05 and ABCD 02-08 are exactly the same thing, only sizes are different). I have thousands of items named like this on my Excel worksheet, which I have to sum the quantity of all items like ABCD01, 02-05 and ABCD 02-08. (Notice that some items name have space between letter and number, some don’t. )

    I would really appreciate if someone knows how to organize these items only by the first 4 alphabets and auto sum the quantity if they are the same thing.

    Thanks a lot for all your help!


    Amy
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You can use Sumif() with wildcards...

    e.g. =Sumif(A1:A100,"ABCD*",B1:B100) will sum column B where column A starts with "ABCD"

    Note: You can replace "ABCD" with a cell reference containing that string.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-11-2008
    Posts
    27

    How to use cell reference to keep first 4 letters

    Hi NVBC,

    I appreciate for your reply and suggestion. The Sumif formula you suggested only works for one item like "ABCD*", whereas I have thousands of different items suck like "BCDE*" "GDDS*" in column A, I don't think sumif works in this case?

    Would you please be more specific how can I use cell reference to only keep the first 4 alphabets in column A? I have never used this function in Excel before.


    Thanks again!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    So say you have ABCD, BCDE and GDDS listed separately like in your sample file, say in cells G1, G2 and G3...

    then your Sumif() formula would be something like:

    =Sumif($A$1:$A$100,G1&"*",$B$1:$B$100) copied down

    so the first result would be for all the ABCD*, the second for the BCDE* and the third for teh GDDS*...and so on.

+ 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