ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need a zero value (https://www.excelbanter.com/excel-discussion-misc-queries/43554-need-zero-value.html)

heater

Need a zero value
 
I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!



David Hepner

See if this works for you:

=IF(AND(J5="",L5=""),0,L5/J5)

"heater" wrote:

I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!



Dave Peterson

=if(count(j5,l5)=0,"",.....)

or maybe...
=if(count(j5,l5)<2,"",.....)

if both must be filled in.

=count() counts numbers
=counta() counts anything

heater wrote:

I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!


--

Dave Peterson

KL

Hi,

Do you really mean the cells [J5] and/or [L5] are empty or do they return a
zero-length string as a result of a similar formula, such as
=IF(condition,1,""). If the latter is true then try the following formula:

=IF(OR(J5="",L5=""),"",L5/J5)

Regards,
KL


"heater" wrote in message
...
I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!





heater

It worked - Thanks!

"David Hepner" wrote:

See if this works for you:

=IF(AND(J5="",L5=""),0,L5/J5)

"heater" wrote:

I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!



David Hepner

Looking at this again, I would use OR instead of AND


IF(OR(J5="",L5=""),0,L5/J5)



"heater" wrote:

It worked - Thanks!

"David Hepner" wrote:

See if this works for you:

=IF(AND(J5="",L5=""),0,L5/J5)

"heater" wrote:

I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!



heater

That works too!

"KL" wrote:

Hi,

Do you really mean the cells [J5] and/or [L5] are empty or do they return a
zero-length string as a result of a similar formula, such as
=IF(condition,1,""). If the latter is true then try the following formula:

=IF(OR(J5="",L5=""),"",L5/J5)

Regards,
KL


"heater" wrote in message
...
I need a zero value when J5 and L5 are empty (blank). I keep getting
#VALUE!. I've tried the following formulas:
=IF(J50,L5/J5,IF(J5<0,0))
=IF(J50,L5/J5,0)
=IF(J5=0,"",L5/J5)
All return #VALUE!







All times are GMT +1. The time now is 08:42 AM.

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