+ Reply to Thread
Results 1 to 5 of 5

I need a formula to sum numbers based on criteria on the left side of the number.

  1. #1
    Registered User
    Join Date
    02-03-2013
    Location
    Curacao
    MS-Off Ver
    Excel 2007
    Posts
    15

    I need a formula to sum numbers based on criteria on the left side of the number.

    Hi guys.

    I would be able to get this done with SUMIF if my setting were a little bit different, but I need it in this particular way, and SUMIF doesn't get it done.
    Please see attachment. In Cell P2, I need a formula to count all "VD" in the cell range B2:O2, and then sum the number that is on the right side next to all cell containing "VD". For example for the cell range B2:02, there are three cells containing "VD" and the sum of the cells right next to them is 24 (3x8), so the value in cell P2 should be 24.

    Any help would be appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: I need a formula to sum numbers based on criteria on the left side of the number.

    Hi,

    The entry in J2 has an additional space at the end, i.e. "VD ", so that will need amending first.

    Why isn't SUMIF applicable here?

    =SUMIF(B2:N2,"VD",C2:O2)

    and copied down.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    02-03-2013
    Location
    Curacao
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: I need a formula to sum numbers based on criteria on the left side of the number.

    Ohh...that was my mistake
    I had the formula =SUMIF(B2:N2,"VD",B2:O2)
    and it would always turn out 0.

    Thank you!

  4. #4
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: I need a formula to sum numbers based on criteria on the left side of the number.

    at P2 array formula (CSE)

    =SUM(IF(TRIM(A2:N2)="VD",B2:O2))

    copy down

  5. #5
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: I need a formula to sum numbers based on criteria on the left side of the number.

    Please refer to the file.

    In it I suggested 2 distinct ways to attain your desired sum.
    The first one relies on the formula to the right of the table. In short, it is a series of if()s for each cell,
    The second solution is a macro that will give you the table that starts on line 10. It will count all different entries.
    Attached Files Attached Files

+ 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: 14
    Last Post: 09-03-2018, 01:45 PM
  2. [SOLVED] How can I change Chart.Axes(xlValue) from left side to right side ?
    By HerryMarkowitz in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-15-2014, 02:18 PM
  3. [SOLVED] SUMIF function but the SUM RANGE is on the LEFT SIDE of the CRITERIA.
    By Jarvin24 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-19-2014, 11:02 PM
  4. [SOLVED] How to shift numeric number from left side to right side of a particular word
    By nur2544 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-13-2013, 09:05 AM
  5. [SOLVED] How to move data from right side to left side, please check the attachment
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2013, 03:43 AM
  6. Replies: 2
    Last Post: 02-05-2012, 01:21 PM
  7. [SOLVED] adding 0's to the left side of a constant number cell
    By faisal alfadl in forum Excel General
    Replies: 1
    Last Post: 11-25-2005, 01:10 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