ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   #DIV/0! (https://www.excelbanter.com/excel-worksheet-functions/151107-div-0-a.html)

quattda

#DIV/0!
 
I am working on a time sheet with Cell H3 being a sum of actual times
calculated from a range of other start and end time cells. If there is no
start/end times entered the return value in the cell is 0. I am then
calculating a wage value based on the expected time (H2) vs actual time (H3).
However, if there is no actual time value entered I get the #DIV/0! error
message. Obviously, this is because of the 0 in the denominator position.
I have used the formula: =IF(H3=0,12,(H2/H3)*12) to try to eliminate this
but I still get the error message. What am I doing wrong?

Barb Reinhardt

#DIV/0!
 
How about

=IF(ISERROR(H2/H3),12,(H2/H3)*12)

"quattda" wrote:

I am working on a time sheet with Cell H3 being a sum of actual times
calculated from a range of other start and end time cells. If there is no
start/end times entered the return value in the cell is 0. I am then
calculating a wage value based on the expected time (H2) vs actual time (H3).
However, if there is no actual time value entered I get the #DIV/0! error
message. Obviously, this is because of the 0 in the denominator position.
I have used the formula: =IF(H3=0,12,(H2/H3)*12) to try to eliminate this
but I still get the error message. What am I doing wrong?


quattda

#DIV/0!
 
That did it. I had tried using ISERROR before but had only entered the H3
cell designation instead of the ratio formula. As always, the answer is
obvious NOW. Thanks a lot.

"Barb Reinhardt" wrote:

How about

=IF(ISERROR(H2/H3),12,(H2/H3)*12)

"quattda" wrote:

I am working on a time sheet with Cell H3 being a sum of actual times
calculated from a range of other start and end time cells. If there is no
start/end times entered the return value in the cell is 0. I am then
calculating a wage value based on the expected time (H2) vs actual time (H3).
However, if there is no actual time value entered I get the #DIV/0! error
message. Obviously, this is because of the 0 in the denominator position.
I have used the formula: =IF(H3=0,12,(H2/H3)*12) to try to eliminate this
but I still get the error message. What am I doing wrong?


Harlan Grove[_2_]

#DIV/0!
 
"Barb Reinhardt" wrote...
How about

=IF(ISERROR(H2/H3),12,(H2/H3)*12)

....

Usually not a good thing to hide errors that would propagate if either H2 or
H3 evaluated to errors. Usually just better to test whether H3 is nonzero.

=IF(H3,12*H2/H3,12)

This will return #VALUE! if H3 contains nonnumeric text.




All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com