# Simple "IF" statement for a newbie

##### New Member
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.

#### Peter_SSs

##### MrExcel MVP, Moderator
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-5000
28000green
3-285green
4-55green
5-721amber
60green
7200green
 redambergreen

##### New Member
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

#### LlebKcir

##### Board Regular
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.

#### Peter_SSs

##### MrExcel MVP, Moderator
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.

##### New Member
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

#### LlebKcir

##### Board Regular
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

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

 -1501 RED -600 AMBER 600 RED

<tbody>
</tbody>

#### Peter_SSs

##### MrExcel MVP, Moderator
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:

1,081,659
Messages
5,360,313
Members
400,580
Latest member
Drexl88

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...