#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Formula Help

This has got me really scratching my head.

I have the following formula in a table:

=IF(B26=25,"",IF(G5=G50,"YES",""))

The problem is thatt B26 is less than 25 (8), and so the answer comes
up blank. But if I change the formula to:

=IF(B26<=25,"",IF(G5=G50,"YES",""))

Then the cell will say, "YES."

What am I doing wrong?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Formula Help

Well, what do you want to happen if B26 is less than 25?

Pete

On Dec 20, 12:50 am, Peter wrote:
This has got me really scratching my head.

I have the following formula in a table:

=IF(B26=25,"",IF(G5=G50,"YES",""))

The problem is thatt B26 is less than 25 (8), and so the answer comes
up blank. But if I change the formula to:

=IF(B26<=25,"",IF(G5=G50,"YES",""))

Then the cell will say, "YES."

What am I doing wrong?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Formula Help

If B26 is <25, then the word YES will show up in the cell.

On Wed, 19 Dec 2007 16:58:30 -0800 (PST), Pete_UK
wrote:

Well, what do you want to happen if B26 is less than 25?

Pete

On Dec 20, 12:50 am, Peter wrote:
This has got me really scratching my head.

I have the following formula in a table:

=IF(B26=25,"",IF(G5=G50,"YES",""))

The problem is thatt B26 is less than 25 (8), and so the answer comes
up blank. But if I change the formula to:

=IF(B26<=25,"",IF(G5=G50,"YES",""))

Then the cell will say, "YES."

What am I doing wrong?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Formula Help

On Dec 19, 6:24 pm, Peter wrote:
If B26 is <25, then the word YES will show up in the cell.


What you wrote previously is effectively:

=if(and(B26<25,G25=50), "YES", "")

Are you trying to write:

=if(or(B26<25,G25=50), "YES", "")


----- previous posting -----

On Dec 20, 12:50 am, Peter wrote:
This has got me really scratching my head.


I have the following formula in a table:


=IF(B26=25,"",IF(G5=G50,"YES",""))


The problem is thatt B26 is less than 25 (8), and so the answer comes
up blank. But if I change the formula to:


=IF(B26<=25,"",IF(G5=G50,"YES",""))


Then the cell will say, "YES."


What am I doing wrong?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Formula Help

PS....

On Dec 19, 4:50 pm, Peter wrote:
if I change the formula to:
=IF(B26<=25,"",IF(G5=G50,"YES",""))

Then the cell will say, "YES." What am I doing wrong?


If that is what you want, then perhaps you made only two mistakes in
your second effort. Perhaps you wanted the following:

=if(B26<25, "YES", if(G5=G50, "YES", ""))

Note: "<25", not "<=25".

Generally, that is equivalent to the IF(OR(...),...) formula that I
suggested. Arguably, one advantage of your second formulation is that
it will return "YES" if B26 is less than 25, even if G5 contains an
error.

I would prefer to avoid any hypothetical errors in G5. But to each
his own.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 27
Default Formula Help

What I want is if B26 is greater than or equal to 25 then nothing
appears in the cell. Then if G5 is greater than or equal to G50, then
I want the word YES to appear in the cell.

Note: "<25", not "<=25".


Isn't <= how you write "less than or equal to?"


On Wed, 19 Dec 2007 20:01:29 -0800 (PST), joeu2004
wrote:

PS....

On Dec 19, 4:50 pm, Peter wrote:
if I change the formula to:
=IF(B26<=25,"",IF(G5=G50,"YES",""))

Then the cell will say, "YES." What am I doing wrong?


If that is what you want, then perhaps you made only two mistakes in
your second effort. Perhaps you wanted the following:

=if(B26<25, "YES", if(G5=G50, "YES", ""))

Note: "<25", not "<=25".

Generally, that is equivalent to the IF(OR(...),...) formula that I
suggested. Arguably, one advantage of your second formulation is that
it will return "YES" if B26 is less than 25, even if G5 contains an
error.

I would prefer to avoid any hypothetical errors in G5. But to each
his own.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Formula Help

On Dec 19, 9:34 pm, Peter wrote:
What I want is if B26 is greater than or equal to 25 then nothing
appears in the cell. Then if G5 is greater than or equal to G50, then
I want the word YES to appear in the cell.


Do you mean that you want "" when B26=25, regardless of the value in
G5; otherwise (when B26<25) you "YES" when G5=G50; and otherwise
(when B26<25 and G5<G50) you want ""?

If so, that is what your original formula does. But you said that is
not giving the desired result when B26<25. In response to Pete-UK,
you said: "If B26 is <25, then the word YES will show up in the
cell". I interpreted "will" to mean that is what you want; that is,
you want "YES" when B26<25 as well as when G5G50.

Before you can write an IF expression correctly, you need to fully
specify your requirements, taking all combination of conditions into
account. English description can be ambiguous. One way to do that is
to fill out the following table (sorry for any alignment problems):

G5<G50 G5=G50 B5G50
------------ ------------- -----------
B26<25 xxx xxx xxx
B26=25 xxx xxx xxx
B2625 xxx xxx xxx

Replace "xxx" with the desired result, "YES" or "". Some of those
combination might become redundant and reducible after you fill in the
table.


Note: "<25", not "<=25".


Isn't <= how you write "less than or equal to?"


Yes. But in your original posting, you wrote that the problem arises
when "B26 is less than 25". "Less than" (<) is the opposite of
"greater than or equal" (=), not "less than or equal" (<=).
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Formula Help

That's what the first formula of your original message does:
=IF(B26=25,"",IF(G5=G50,"YES",""))

What is your problem?
What are your values in B26, in G5, and in G50? What result does it give,
and what result did you expect?
Note that you haven't specified in your words below what you want if B26<25
and G5<G50, and the formula gives an empty string. If you want something
different, then
=IF(B26=25,"",IF(G5=G50,"YES","whatever alternative result you want"))
--
David Biddulph

"Peter" wrote in message
...
What I want is if B26 is greater than or equal to 25 then nothing
appears in the cell. Then if G5 is greater than or equal to G50, then
I want the word YES to appear in the cell.

....


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



All times are GMT +1. The time now is 03:39 AM.

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"