+ Reply to Thread
Results 1 to 10 of 10

Sum quantity of first column

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Cluj Napoca, Romania
    MS-Off Ver
    Excel 2003
    Posts
    14

    Sum quantity of first column

    I have 3 columns:
    in first cell (A1) i have a code: 553482300040
    in second cell (B1) quantity: 1000
    and in third cell (C1) i have first 2 numbers from first cell (A1), in that case 55.
    In second row, first cell (A2) i have another code, but begins with 55 too, in second cell (B2) i have quantity for this: 500.

    What i have to do is to sum the quantity of the products in third cell, row 1 (A3).
    Can someone help me?

    Thank you!
    Last edited by esential; 10-06-2009 at 07:47 AM.

  2. #2
    Registered User
    Join Date
    10-06-2009
    Location
    Cluj Napoca, Romania
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: VBA help please!

    to be more explicite:

    Code______________Quantity

    553282300000________ 50______________55
    553290240040________160______________58
    553480480020________420______________7E
    553492300040________ 20
    583182300060SMA____100
    585281100060SMA____ 80
    7E1382300000________15
    7E1682300000________38
    7E3684000000________73
    7E3684000002________57

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum quantity of first column

    =Sumif($A$1:$A$100,C1&"*",$B$1:$B$100)

    where A1:A100 hold codes and B1:B100 hold quantities

    C1 holds 2-digit code "55"

    Copy formula down.
    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.

  4. #4
    Registered User
    Join Date
    10-06-2009
    Location
    Cluj Napoca, Romania
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Sum quantity of first column

    can i make this in macro?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Sum quantity of first column

    Note that SUMIF with a wildcard will only work if column A values are text. If they are numbers try

    =SUMPRODUCT((LEFT(A$1:A$100,2)=C1&"")+0,B$1:B$100)

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum quantity of first column

    Quote Originally Posted by esential View Post
    can i make this in macro?
    If you wanted a macro, you needed to post in the Programming forum and explicitly say you want a macro to do this....

    Please post in the Programming forum.

  7. #7
    Registered User
    Join Date
    10-06-2009
    Location
    Cluj Napoca, Romania
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Sum quantity of first column

    Thank you! Both functions work perfectly

    I posted this on Programing forum, but someone moved it.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum quantity of first column

    Perhaps because the question didn't mention you wanted a macro to do the job... and it looks like you are asking for a formula.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sum quantity of first column

    And for the record I did not move the thread ... were your thread moved you would traditionally be notified as such.

  10. #10
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Sum quantity of first column

    Technically, as "Excel Worksheet Functions" is a sub-forum of "Excel Programming" then the thread still is "in the programming forum". I've never really understood why it's structured that way........

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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