Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Reference range of cells and perform subtraction or nothing depending on contents

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

Truly,

Robert
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Reference range of cells and perform subtraction or nothing depending on contents

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

where you put the W and O in column A

--
Regards,

Peo Sjoblom

Portland, Oregon




"bob-hamilton" wrote in message
...

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

Truly,

Robert


--
bob-hamilton


  #3   Report Post  
Junior Member
 
Posts: 2
Default

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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Reference range of cells and perform subtraction or nothing depending on contents

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




"bob-hamilton" wrote in message
...

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



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

where you put the W and O in column A

--
Regards,

Peo Sjoblom

Portland, Oregon




"bob-hamilton" wrote in
message
...

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

Truly,

Robert


--
bob-hamilton



--
bob-hamilton


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert a reference table and have different size cells bill Excel Discussion (Misc queries) 0 January 16th 06 09:53 PM
Using a cells contents to reference a sheet. JoeM Excel Worksheet Functions 3 December 13th 05 07:12 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Display first, second, etc Nonblank Cells in a Range Jeremy N. Excel Worksheet Functions 12 September 25th 05 01:47 PM
How do I average a range of cells when one cell contains #N/A hongkonglt Excel Discussion (Misc queries) 3 September 19th 05 02:13 AM


All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"