+ Reply to Thread
Results 1 to 6 of 6

Add numbers based on criteria from specific cell on same row

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Add numbers based on criteria from specific cell on same row

    Hi Guys,

    I'm looking for a way within excel to add data based on a cell's criteria. I have certain account numbers, they're not traditional numbers such as 1,2,3, they have dashes in them. Below is how the data looks.

    A B C D
    6311.100 expenses 01-174-6311.100 1000
    6311.200 expenses 01-174-6311.200 2000
    6311.300 expenses 01-174-6311.300 3000
    6311.400 expenses 01-174-6311.400 4000
    6311.500 expenses 01-174-6311.500 5000


    This is just an example of how it looks, I've added 4 columns, I want to be able to sum up the numbers from column D(1000,2000,3000) based on column C's numbers. So let's say I want to add all cells from 'column D' that have "column C" range of "01-174-6311.100 - 01-174-6311.400". How would I go about doing that. If it's done correctly, it would add 1000,2000,3000,4000 since those are the only one with their 'column c' data falling between "01-174-6311.100 - 01-174-6311.400".

    To sum it up, all cells from 'column d' who's cell from 'column c' falls withing the given range would be added, and anything out of the range would be skipped. So for the first row, before deciding if 1000 should be summed up, "cell C(01-174-6311.100" would be checked to see if it falls within the range. For the second column, before deciding if 2000 should be added, "cell C(01-174-6311.200" would be checked.

    I would much rather use a function within excel if that's possible, if not, I'll try a macro code.
    data.png

    Thanks in advance for any help!
    Last edited by nitreb; 08-21-2013 at 12:58 AM. Reason: Data inserted is messed up, added picture for better view

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Add numbers based on criteria from specific cell on same row

    Hi,

    Try the following formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    To change the formula to match your needs, please consider the following ranges:
    1. My column C and D are as above in your example
    2. I entered the minimum column C value in cell G2
    3. I entered the maximum column C value in cell G3

    Let me know how this goes for you

  3. #3
    Registered User
    Join Date
    08-21-2013
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Add numbers based on criteria from specific cell on same row

    Hi nitreb,

    Step 1 Select the columns with the "account numbers", right click and select "Format Cells".
    Step 2 Ensure the "Number" tab is select and choose "Custom" from the list on the left hand side.
    Step 3 Enter the following custom format: "00-000-0000.000".
    Step 4 Remove all the dashes from your data (they will be now display there even if they aren't there).
    Step 5 Enter the following formula in the cell you wish the total to appear: =SUMIF(C1:C5,">11746311.099",D1:D5)-SUMIF(C1:C5,">11746311.499",D1:D5)"

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Add numbers based on criteria from specific cell on same row

    The formula gives total from 200 to 400 (values can be changed).


    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 08-21-2013 at 02:48 AM.

  5. #5
    Registered User
    Join Date
    08-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Add numbers based on criteria from specific cell on same row

    Huge thanks guys, I only tried ajryan88's formula, it worked so I will be using his. Again HUGE thanks to all of you

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Add numbers based on criteria from specific cell on same row

    You're welcome!

    Please don't forget to mark this thread as solved and click on the * next to any posts that you think are worthy of a thank you!

    Have a great day

+ 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. Autofill on specific cell based on search criteria
    By donmach in forum Excel General
    Replies: 5
    Last Post: 06-08-2012, 05:17 PM
  2. Macro to insert data in specific cell based on criteria
    By SAsplin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2011, 08:08 AM
  3. Search for a specific cell based on two criteria
    By RoVo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2006, 01:10 PM
  4. Transfer single cell information to specific cell based on user criteria
    By RoVo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2006, 11:30 AM
  5. [SOLVED] I am trying to color fill a cell based on specific criteria
    By jglen in forum Excel General
    Replies: 1
    Last Post: 05-27-2005, 01:05 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