Reference range of cells and perform subtraction or nothing depending on contents

B

bob-hamilton

Thanks in advance for the help. My sheet is for calculating per-die
for employees. Their starting per-diem is 600, and every day the
work, I subtract 30 from the 600. So, on days that they work, I put
"W" in the corresponding day and an "O" if they don't work. Is there
formula that will examine a range of cells containing "W" or "O" an
subtract 30 if "W" appears and do nothing if "O" appears, then keep
running total of the per-diem that is left?

Truly,

Rober
 
P

Peo Sjoblom

=MAX(0,600-COUNTIF(A:A,"W")*30)

where you put the W and O in column A

--
Regards,

Peo Sjoblom

Portland, Oregon
 
B

bob-hamilton

Thanks for the post,

I have an answer that worked good,

=600-30*COUNTIF(range,"W")

Where range is the range of cells that contain "W" or "O"

Bye for now.

Robert
 
P

Peo Sjoblom

It does the same thing, the only difference is that my stop at 0 while the
one you have goes to negative if the number of Ws will be more than 20,
don't know why but I assumed you wanted to subtract until you got to 0

--
Regards,

Peo Sjoblom

Portland, Oregon
 
Top