adeibiza
adeibiza

Reputation: 23

If cell 1 = x then cell 2 =y or cell 1 =y then cell 2 =z etc

I have scores from pool matches in a Google Docs spreadsheet where A1 value is between 0 and 9. If:

a1 = 0-3   a2=0
a1 = 4     a2=1
a1 = 5-7   a2=3
a1 = 8     a2=4
a1 = 9     a2=5

I tried:

=if(OR(a1="4",b1="1",=if(OR(a1="5",b1="3",=if(OR(a1="6",b1="3",=if(OR(a1="7",b1="3",=if(OR(a1="8",b1="4",=if(OR(a1="9",b1="5","0"))))))  

but comes up with an error.

Upvotes: 1

Views: 1003

Answers (1)

pnuts
pnuts

Reputation: 59485

Please try:

=if(A1>8,5,if(A1=8,4,if(A1>4,3,if(A1=4,1,0))))

Alternatively a little lookup table and VLOOKUP with inexact matching:

SO28971265 example

Upvotes: 2

Related Questions