if statement with multiple criteria

  • Thread starter Thread starter Tom G
  • Start date Start date
T

Tom G

I am using a simple if:

=IF(I20=21.1,1,0)

However, I need the criteria to encompass anyone of 25 values.

Thanks,

tom
 
Hi Tom
you may have a look at the VLOOKUP function (if I understood you
correctly). You may also provide some more detail what you're trying to
achieve (e.g. give us an example)
 
Hi Frank,

I have a cell (A2) which can contain any one of 100 values. Some are for
high schools and some are for middle schools.

I need to give principals a comparison between their school and other
similar schools (i.e., if they are in a high school, I want to compare them
only to other high schools).

I want to be able to allow the principal to enter his number school, and
then the sheet will recode it as a 1 or a 2 (middle school or high school).
I will then use this 1 or 2 for other calculations.

thanks,

Tom
 
Hi Tom
so there is no logic for the mapping of your school number and the
mirroring to 1 or 2. In this case try the following:
1. Create a separate lookup sheet (calls this for example
'number_lookup'). It should have the following layout:
A B
1 school no. Type
2 21 1
3 22 2
4 23 2
5 24 1
....
so this table maps your school number to your school type

Now use the following formula on your other sheet:
=VLOOKUP(A2,'number_lookup'!$A$1:$B$100,2,0)

to return for the value in A2 the corresponding tybpe number
 
Back
Top