ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formula Modification (https://www.excelbanter.com/excel-programming/282742-formula-modification.html)

Phil Hageman[_3_]

Formula Modification
 
This formula works okay when cell U51 is either blank or
with data greater than zero; however, I now need to modify
the formula for the case when cell U51 has a zero posted
in it - so it returns a zero answer - with the other
features still intact.

=IF(U51<0,(U51-V42)/(P42-V42),"")


Edwin Tam (MS MVP)

Formula Modification
 
Your question is unclear as you missed two cases

What do you want when
1) U51<0 (negative value
1) U51 is not blank and not numeric. For example, U51 contains tex

Besides, your formula is wrong because you said the result is ok when
1) U51 greater than zero; an
2) U51 is blank

But your formula also deals with value smaller than zero
You should use U510 instead of U51<0

Please give more details. Thanks


Tom Ogilvy

Formula Modification
 
If you are happy with it now, this should do what you want:

=IF(U51<0,(U51-V42)/(P42-V42),IF(U51="","",IF(U51=0,0,"")))

--
Regards,
Tom Ogilvy


"Phil Hageman" wrote in message
...
This formula works okay when cell U51 is either blank or
with data greater than zero; however, I now need to modify
the formula for the case when cell U51 has a zero posted
in it - so it returns a zero answer - with the other
features still intact.

=IF(U51<0,(U51-V42)/(P42-V42),"")




Phil Hageman[_3_]

Thanks
 
James, works just as I needed. Thanks for your time.
-----Original Message-----
try this:

=IF(U51="","",IF(U51<0,(U51-V42)/(P42-V42),0))

An if statement tests for 2 values, but you are testing
for 3, so a nested if should work.

James

-----Original Message-----
This formula works okay when cell U51 is either blank or
with data greater than zero; however, I now need to

modify
the formula for the case when cell U51 has a zero posted
in it - so it returns a zero answer - with the other
features still intact.

=IF(U51<0,(U51-V42)/(P42-V42),"")

.

.


Phil Hageman[_3_]

Thanks
 
Tom, works just as I needed. Thanks for your time.
-----Original Message-----
If you are happy with it now, this should do what you

want:

=IF(U51<0,(U51-V42)/(P42-V42),IF(U51="","",IF

(U51=0,0,"")))

--
Regards,
Tom Ogilvy


"Phil Hageman"

wrote in message
...
This formula works okay when cell U51 is either blank or
with data greater than zero; however, I now need to

modify
the formula for the case when cell U51 has a zero posted
in it - so it returns a zero answer - with the other
features still intact.

=IF(U51<0,(U51-V42)/(P42-V42),"")



.



All times are GMT +1. The time now is 11:00 PM.

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