Excel conditional formatting [Closed]

Report
Posts
4
Registration date
Tuesday November 4, 2014
Status
Member
Last seen
November 5, 2014
-
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
-
can I make a cell = a value based on the value of another cell?
example: I want to make A2 = 5 if A1 <40.

7 replies

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
791
"example: I want to make A2 = 5 if A1 <40.
Reply"

in A2 type this formula

=if(a1<40,5,"")
Posts
4
Registration date
Tuesday November 4, 2014
Status
Member
Last seen
November 5, 2014

that works great! thanks! how can I make A2 =4 if A1 is between a range of 40-45?
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
136
MJIMS, Good afternoon.

"...how can I make A2 =4 if A1 is between a range of 40-45?..."

Try to use it:

A2 --> =IF(AND(A1>=40,A1<=45),4,"")

Is it what you want?
I hope it helps.
Posts
4
Registration date
Tuesday November 4, 2014
Status
Member
Last seen
November 5, 2014

wonderful. works like a charm.......now can I combine the 2 into 1 cell?

=if(a1<40,5,"")
and....
=IF(AND(A1>=40,A1<=45),4,"")
together?
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
136
MJIMS, Good evening.

Try to use it:

A2 --> =IF(A1<40,5,IF(A1<=45,4,""))

Is it what you want?
I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão
Posts
4
Registration date
Tuesday November 4, 2014
Status
Member
Last seen
November 5, 2014

Wonderful. I added about 5 more expressions but you gave me the start I needed. Thank you.
Posts
1852
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
November 7, 2020
136
MJIMS, Good morning.

If you have a sequence of intervals to search for, maybe it's better to create a table and use a VLOOKUP function to do the job.

It's a very efficient tool for this kind of work.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!