EXCEL How do I find the sum for a column, but only for values who have a specific value in a different column but in the corresponding row

StackOverflow https://stackoverflow.com/questions/17136043

  •  31-05-2022
  •  | 
  •  

Question

I apologize if my question is confusing, I'm not too good with excel and the formula I'm trying to come up with is giving me headaches, so let me try to clarify.

In column "A1:A30" I have a date (Sat01Jun2013-Sun30Jun2013).

"B" is a start time (00:00-23:29).

"C1:C30" is an end time (00:29-23:59).

"D1:D30" is a name (ALPHA/BRAVO/CHARLIE/DELTA).

In column "E1:E30" I have an IF formula that is set for that specific row.

If "D" equals ALPHA then a formula that rounds up the difference of "C" minus "B" and converts it into a number where 0.5 equals 30 minutes if not then 0

=IF(D1="ALPHA";(ROUNDUP((C1-B1-INT(C1-B1))*24;1));0)

The same formula is set for each row specifically

In "F" I have the same formula but for BRAVO instead of ALPHA.

"G" for CHARLIE.

"H" for DELTA

In "I" I have the sum of ALPHA/Column "E"

"J" for BRAVO

"K" for CHARLIE

"L" for DELTA

Now I guess here's what I'm getting at. I would rather just have the (ROUNDUP((C#-B#-INT(C#-B#))*24;1)) formula in column "E" And in a different column a formula that added the sum of each value in "E" only if in the corresponding row the value equals "ALPHA".

I would again like to apologize if I am not clear enough in my question, or if I have just given too much unnecessary information. And I would like to thank you in advance if you have given any of your time to help or even if you tried to and were unable. Thank you.

Was it helpful?

Solution

Here is a suggestion on calculating the time difference if columd D = ALPHA. You can use similar foumula for BRAVO and others. You can apply your rounding to this calculated value.

=SUMIF(D1:D30;"ALPHA";C1:C30) - SUMIF(D1:D30;"ALPHA";B1:B30)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top