+ Reply to Thread
Results 1 to 7 of 7

summing up the number of times a text string appears in a range question.

  1. #1
    Registered User
    Join Date
    01-29-2008
    Posts
    10

    summing up the number of times a text string appears in a range question.

    Hi,

    Can this be done?

    I need a spread sheet that keeps track of work items completed at a job site. The problem is that I have about 150 items to keep track of. Here's an example:
    Let's say the following values are placed in cells A1 to J1. Please note that the items in "" are text and the numbers represent the quantity.

    2 "VM5-4" 1 "vm5-20" 5 "vm5-29" 6 "e1-4" 5 "VM5-4"

    Now I want to sum up all like items which could appear anywhere in a range. My first thought was to use the COUNTIF function which works great if I only have one of any item - but I have more than one item.

    So... is there any way I could search a range for a certain text and when it finds a match get it to look in the adjacent box for the quantity and add that to a total?

    Thanks...
    Last edited by mbu; 01-30-2008 at 01:27 PM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Quote Originally Posted by mbu
    So... is there any way I could search a range for a certain text and when it finds a match get it to look in the adjacent box for the quantity and add that to a total?

    Thanks...
    Welcome to the board
    Do you mean that the quantities and description are in the same cell, or in adjacent cells?

  3. #3
    Registered User
    Join Date
    01-29-2008
    Posts
    10
    Quote Originally Posted by arthurbr
    Welcome to the board
    Do you mean that the quantities and description are in the same cell, or in adjacent cells?
    Thanks Arthur!

    The description is in one cell the quantities are in the preceding cell - the descriptions could be "random" throughout the range but the quantities will always be in the preceding cell.

    If what I suggest isn't doable then is there another way I could it?

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi mbu,

    Can you use:

    =SUMIF(B1:B100,"VM5-4",A1:A100)

    This will sum all the values in column A where the corresponding cell in column B is VM5-4.

  5. #5
    Registered User
    Join Date
    01-29-2008
    Posts
    10
    Quote Originally Posted by pjoaquin
    Hi mbu,

    Can you use:

    =SUMIF(B1:B100,"VM5-4",A1:A100)

    This will sum all the values in column A where the corresponding cell in column B is VM5-4.
    pjoaquin,

    Hmmm.. that's a good idea! But...I'll need it to go one step farther.

    How can that instruction be written to jump to the next 2 columns and do the same thing again and still keep the totals? In other words, how can it pick up the values in Column A9 and A10 in my example?

    Thanks!
    Last edited by mbu; 01-30-2008 at 01:12 PM.

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Mbu,

    I'm not sure what you mean. Columns are not named A9 and A10, those are cells. Columns are A, B, C, .. BB, BC, BD.. Rows are 1, 2, 3, .. 9, 10, 11..

    If you want to sum column A whenever column B is "VM5-4" AND sum column G when column H is "VM5-4", just add two SUMIF's together, like so:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-29-2008
    Posts
    10
    Paul,

    Sorry, I should have said columns I and J.


    Nevertheless...I think you have the solution for what I need. I'll try it!

    Thanks very much!!!

+ 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