IF statement problem

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I am getting an error with the following formula:

=IF(G2193<20000,20000,(G2193+1000),if(G2193=>50000,50000))

I've tried multiple combinations with parentheses, but I
can't figure out what it wants. Can someone please tell
me what I'm doing wrong?
 
Hi Lee!
You've got too many arguments

=IF(A test that is either true or false here , what to do
if the test was true here , what to do if the test was
false here) That's three fields separated by two commas.
You've got 4 fields in your first IF and 2 in your second.

I'm not sure exactly what you're trying to do but perhaps
this is it.
=MAX(20000,IF(G2193<50000,G2193+1000,50000))

or

=MIN(50000,IF(G2193<20000,20000,G2193+1000))

or

=MIN(50000,MAX(G2193+1000,20000))

alternatively

=MAX(20000,MIN(G2193+1000,50000))

You need to decide where you want the value to go if
G2193 is 49001 to 49999 and 19001 to 19999. That was a
little unclear.

Scott
btw I'm still new at this, so use it at your own risk.
 
OR You could try this:

=IF(G2193<20000,20000,IF(G2193>=50000,50000,(G2193+1000)))

Regards
Michael
 
Hi Lee!

You had two errors:

First is syntax error of the IF function which should be:

=IF(Condition,True,False) where false is optional argument

The second is the operator =>. It should be >= for great than or equal
to.

I may have misinterpreted your logic but I get:

=IF(G2193>=50000,50000,IF(G2193>20000,G2193+1000,20000))

But I think that you probably want:

=IF(G2193>20000,MAX(50000,G2193+1000),20000)

The second approach covers entries of 49500 which might otherwise
return 50500. You may not want this.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Lee
I didn't quite follow whether the 20000 and 50000 were
including the added 1000 or not. My previous post suggests
not. If you did want the 1000 included, try this:

=IF((G2193+1000)<=20000,20000,IF((G2193+1000)>=50000,50000,
(G2193+1000)))

Regards
Michael
 
Back
Top