View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Trevor Shuttleworth Trevor Shuttleworth is offline
external usenet poster
 
Posts: 1,089
Default A range of values transformed

Alex

try this:

=IF(A7=0,1,IF(AND(A7=1,A7<=10),2,IF(AND(A7=11,A7 <=25),3,IF(AND(A7=26,A7<=
75),4,5))))

This tests cell A7; modify to your requirements.

Regards

Trevor


"Alex" wrote in message
...
I want to make a rule that if a cell has a range of
values, it is coded a certain way. How would I do this
this?

For example,
I have a row of values
5, 79, 21, 0

With the key of
0 = 1
1-10 = 2
11-25 = 3
26-75 = 4
75 = 5


Leading to:
2,5,3,1

How would I write this with a simple excel program?
I was thinking of combining if statements, but the formula
gets too large.

PLEASE HELP!
Thank you!
Alex