Is it possible to use a formula SUM the cell to the right where certain texts are found?

I'm really wanting to use formulas (instead of VBA) for this one since I don't know any code (I'm working on that!).

Basically, what I'm trying to do is SUM all numbers when certain text is found on the immediate right (sheet linked below).

For example, something like this...

Total in P23 for all cells with "MP" or "MN" to the immediate right.

Total in P24 for all cells with "V" to the immediate right.

For instance, if C11, G13, and M17 contained "V" then I would like to total B11, F13, and L17 in P24.

Here is a link to my sheet. ANY help is very much appreciated!!

https://dl.dropboxusercontent.com/u/7186315/Hourly%20Timesheet%20v4%20in%20Excel.xlsx

July 7th, 2013 6:28pm

Hello,

as a general tip: try to design your sheet without using merged cells. Merged cells make many operations and formulas very difficult or impossible.

Re your question: Put this formula into cell P23:

=COUNTIF(B9:O16,"FH")

To add up several codes in one cell, for example MP and MN, use

=COUNTIF(B11:O18,"MP")+COUNTIF(B11:O18,"MN")

cheers,


Free Windows Admin Tool Kit Click here and download it now
July 7th, 2013 7:17pm

Hi Teylyn - Thank you so much for both of those tips. That seems to have counted the number of instances of "MP" and "MN", but I was hoping to SUM the values in B11:O18 where this condition is met. I tried SUMIF in the place of COUNTIF but that didn't seem to work. Any thoughts? Thanks again!
July 7th, 2013 8:10pm

Ah, this does the trick:

=SUMIF(C11:O18, "MP",B11:O18)+SUMIF(C11:O18,"MN",B11:O18)

I'm going to mark yours as the answer because I don't think I was clear enough that I wanted to SUM the values and not merely count the instances.

Free Windows Admin Tool Kit Click here and download it now
July 7th, 2013 8:25pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics