Need some help with an IF statement

superkopite

Board Regular
Joined
Jun 28, 2007
Messages
54
Hi Guys and Gals,

I have the statement =IF(O$2=$C3,1,)

and I need to amend it slighty. At the moment the highlighted cell will display a 1 if the value of o2 is equal to c3. What i want to do is that add another condition, so if o2=C4 AND C4 is equal to green then 1,if it is equal to Amber then 2, and 3 if it is equal to Red.

I am sure I know how to do this but think I have just confused myself, lol

Many Thanks

James
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I have tried

=IF(and(G$2=$C3, e3="green"),1,if(and(G$2=$C3, e3="Amber"),2,if(and(G$2=$C3, E3="red",3,0)

But I am missing the ))) and cannot work out where to put them

any ideas??

Thanks
 
Upvote 0
looks like you're missing a parenthesis after the 3rd AND

=IF(AND(G$2=$C3, E3="green"),1,IF(AND(G$2=$C3, E3="Amber"),2,IF(AND(G$2=$C3, E3="red"),3,0)))
 
Upvote 0

Forum statistics

Threads
1,206,754
Messages
6,074,750
Members
446,082
Latest member
fgiron83

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