Trying to write a logical formula

Copper Contributor

Hi

 

I'm trying to write a logical formula for the first time and am not succeeding.

 

The formula needs to work as follows:

 

if the value is less than 12, then 2.0

if the value is 12 to less than 18, then 1.5

if the value is 18 or more, then 1.25

 

I appreciate any help that can be offered.

 

Thank you 

6 Replies

@laurelb2003 

=LOOKUP(I1,{0,12,18},{2,1.5,1.25})

 

Thank you. When I try this I get 2 for every value. Is there something else I need to do?

@laurelb2003 

 


if the value is less than 12, then 2.0

if the value is 12 to less than 18, then 1.5

if the value is 18 or more, then 1.25

 

Suppose the value is in cell A1. Here are several options you can try:

1) Using IFS

 

=IFS(A1<12,2,A1<18,1.5,TRUE,1.25)

 

 2) Using nested IF

 

=IF(A1<12,2,IF(A1<18,1.5,1.25))

 

3) Using XLOOKUP

 

=XLOOKUP(A1,{0,12,18},{2,1.5,1.25},,-1)

 

 

That works. Thank you. I just had to change the True in the IFS to 2.
Hi. This isn't actually working. Should A be the letter of the cell number the height is in? I tried that and A and every height is coming out with the same answer
Try the formulas on a new workbook.