Simple "IF" statement for a newbie

ahmedsadak

New Member
Joined
Sep 19, 2019
Messages
8
I have a sheet which has a list of numbers ranging from -10000 to 10000. I need an IF statement which says if the number is less than -1500 then it should read "red" if it is less than -500 then read "amber" and if it is greater than -500 then should read "green"

I can get it do parts but struggling really, any help would be appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Welcome to the MrExcel board!

.. if it is less than -500 then read "amber" and if it is greater than -500 then should read "green" ..
This doesn't tell us what to do if exactly equal to -500, but see if this is any use.

Excel Workbook
AB
1-5000red
28000green
3-285green
4-55green
5-721amber
60green
7200green
redambergreen
 
Upvote 0
Hi
thanks for the answer, sorry i wasnt clear enough, it should be less than or equal to or Greater than or equal to. - would i use LOOKUP rather than IF with an AND
 
Upvote 0
Nice, had no clue you could use Lookup in that way. I would have gone straight to conditional formatting with three color and use the => to set the values.
 
Upvote 0
This still isn't clear. Which one is it?
.. it should be less than or equal to or Greater than or equal to. ...

Please spell out again carefully in full the requirement for each colour result.
 
Upvote 0
This still isn't clear. Which one is it?


Please spell out again carefully in full the requirement for each colour result.


Apologies.

A1 has a list of numbers.
between -10,000 and 10,000
B2 needs to say Red if the number in A1 is below or equal to -1500 or Amber if it is less than or equal to -500 or Red if it is greater than 500

Thanks in advance
 
Upvote 0
Apologies.

A1 has a list of numbers.
between -10,000 and 10,000
B2 needs to say Red if the number in A1 is below or equal to -1500 or Amber if it is less than or equal to -500 or Red if it is greater than 500

Thanks in advance

Are you saying you want the work RED, the word AMBER, and then the word RED again?

[TABLE="width: 500"]
<tbody>[TR]
[TD]-1501[/TD]
[TD]RED[/TD]
[/TR]
[TR]
[TD]-600[/TD]
[TD]AMBER[/TD]
[/TR]
[TR]
[TD]600[/TD]
[TD]RED[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
B2 needs to say Red if the number in A1 is below or equal to -1500 or Amber if it is less than or equal to -500 or Red if it is greater than 500
Carefully?? Is that last number supposed to be -500? And Red a second time?

Guessing, try
=IF(A1<=-1500,"Red",IF(A1<=-500,"Amber","Green"))

If the 500 at the end of that last quote is correct, what happens above -500 up to and including 500?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top