#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default 'If' problem

I have an 'if' problem which I don't understand and cannot solve.

Cell H2 contains a formula delivering either a value (0) or "".
The formula in I2 reads '=IF(VALUE(H2)0,"sold","-")'. This works
correctly if value(H2)0, but otherwise returns '#VALUE!'.

Thanks in advance for any help to what must be a simple problem.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 'If' problem


Kanga 85;173051 Wrote:
Cell H2 contains a formula delivering either a value (0) or "".
The formula in I2 reads '=IF(VALUE(H2)0,"sold","-")'. This works
correctly if value(H2)0, but otherwise returns '#VALUE!'.

Thanks in advance for any help to what must be a simple problem.


If the formula in H2 shows the text string "0" (without the quotes),
then your IF formula needs to treat that cell as text. Whatever is
showing in cell H2 needs to be EXACTLY tested. So if it's 0 then test
for "0", if it shows (0), then test for "(0)".

=IF(H2="0","sold","-")
or
=IF(H2="(0)","sold","-")

Now, if you change the formula in H2 to just result in numbers, then
your original formula will work. So look at that possibility, too.

Can you show me the formula from H2?


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=47936

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 'If' problem

This should suffice:
=IF(OR(H2="",H2<=0),"-","sold")
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---
"Kanga 85" wrote:
I have an 'if' problem which I don't understand and cannot solve.

Cell H2 contains a formula delivering either a value (0) or "".
The formula in I2 reads '=IF(VALUE(H2)0,"sold","-")'. This works
correctly if value(H2)0, but otherwise returns '#VALUE!'.

Thanks in advance for any help to what must be a simple problem.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 'If' problem

Replace the earlier with this:
=IF(OR(H2="",H2+0<=0),"-","sold")
since there's hints that H2 might return text nums
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 'If' problem

Try this:

=IF(N(H2)0,"Sold","-")

--
Biff
Microsoft Excel MVP


"Kanga 85" wrote in message
...
I have an 'if' problem which I don't understand and cannot solve.

Cell H2 contains a formula delivering either a value (0) or "".
The formula in I2 reads '=IF(VALUE(H2)0,"sold","-")'. This works
correctly if value(H2)0, but otherwise returns '#VALUE!'.

Thanks in advance for any help to what must be a simple problem.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 'If' problem

My interpretation of the OP is that H2 will contain either a formula blank
or a number.

=IF(OR(H2="",H2+0<=0),"-","sold")


If H2 ="" then H2+0 will cause a #VALUE! error.


--
Biff
Microsoft Excel MVP


"Max" wrote in message
...
Replace the earlier with this:
=IF(OR(H2="",H2+0<=0),"-","sold")
since there's hints that H2 might return text nums
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 'If' problem

If H2 ="" then H2+0 will cause a #VALUE! error.
Good point. I overlooked that.
Dismiss my 2nd response.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:22,000 Files:370 Subscribers:66
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default 'If' problem

Thanks to you all for your useful replies. The problem is now solved, and
you have provided me with further insight. The formula in H2 is:
=IF(F20,D2*G2,"")


"JBeaucaire" wrote:


Kanga 85;173051 Wrote:
Cell H2 contains a formula delivering either a value (0) or "".
The formula in I2 reads '=IF(VALUE(H2)0,"sold","-")'. This works
correctly if value(H2)0, but otherwise returns '#VALUE!'.

Thanks in advance for any help to what must be a simple problem.


If the formula in H2 shows the text string "0" (without the quotes),
then your IF formula needs to treat that cell as text. Whatever is
showing in cell H2 needs to be EXACTLY tested. So if it's 0 then test
for "0", if it shows (0), then test for "(0)".

=IF(H2="0","sold","-")
or
=IF(H2="(0)","sold","-")

Now, if you change the formula in H2 to just result in numbers, then
your original formula will work. So look at that possibility, too.

Can you show me the formula from H2?


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=47936


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
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM


All times are GMT +1. The time now is 03:32 PM.

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

About Us

"It's about Microsoft Excel"