Excel Formula Issues

Copper Contributor

I am trying to write a formula in my excel spreadsheet where I am using both greater than and less than symbols. The formula is using a calculation in another cell. If the number is below 1 then 1 is to be placed into the cell. If it is above 8, it is to place 8 there. If it is between these numbers, it places the actual number in the cell.

I know how to do a formula with only 1 variable, but I can not determine how to with both variables.

 

Appreciate any help

 

Alan

3 Replies

Hello @Rascal213,

 

That would be something like this:

=IF(A1<1,1,IF(A1>8,8,A1))

@Rascal213 

If you only have a handful of outcomes, I recommend using VLOOKUP with an approximate match instead of IF-logic.  If you need to do between ranges then you'd need IF-AND.  My approach is this.

 

Consider this example:

0 to 3 is "Low"

4 to 6 is "Medium"

7+ is "High"


A1 contains the number to be checked.

 

Formula:

=VLOOKUP(A1,{0,"Low";4,"Medium";7,"High"},2,1)

@Rascal213 

As variant

=MAX(1,MIN(A1,8))