Have excel return a cell if value is between the value of two cells

203 views Asked by At

I'm trying to let Google Spreadsheets return a text value from one cell if the value is in the right interval. This is my formula so far:

=IF(AND(B4>=C37), A37 , IF(AND(B4>=C38 , B4=C39 , B4=C40 , B4=C41 , B4=C42 , B4

Can anyone tell me what I'm doing wrong?

2

There are 2 answers

0
Rich On

Not sure how your data is laid out but you could use a lookup or vlookup function.

LOOKUP(search_key, search_range|search_result_array, [result_range])

Your column of values goes in the search key, the search range is the cell holding the value you are testing and the result array is a column of text entries.

The column of values and corresponding text entries has to be the same size.

More info here:

https://support.google.com/docs/table/25273?hl=en&rd=2

0
WNG On

Your formula is not complete, the parenthesis should be closed.

If you want B4 to be in a certain interval, you should use

IF (AND(B4C37), "Value if true", "Value if false")

assuming C38 and C37 are the values you want.

Else you will have to describe more precisely your problem, because your formula does not seem to do what you state.