ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Multiple IF Function (https://www.excelbanter.com/excel-worksheet-functions/134250-multiple-if-function.html)

Roberto

Multiple IF Function
 
I have 10 possible ranges to create a cell value. I cannot use "IF" beyond 7
and I keep seeing suggestions to use "Lookup", but it's not working. I need
some examples if they're out there. Here's what I'm trying to do:

If the cell value in "X" is: <30, then value is 1
30-34 then value is 2
35-39 then value is 3
and so on..........

Pete_UK

Multiple IF Function
 
Build up a table of your values, like so:

0 1
30 2
35 3
40 4

etc. Suppose these are in cells X1:Y10. Assume further that the cell
with your "X" values in is A1 and that you want to return the
corresponding value to B1 - put this formula in B1:

=VLOOKUP(A1,X$1:Y$10,2)

The formula can be copied down if you have other values in column A.

In the example you gave there is a simple relationship between between
the numbers you have and the numbers you want, so it may be possible
to calculate them without using a table, but this isn't always the
case - particularly if you wanted to return text values,

Hope this helps.

Pete

On Mar 9, 7:23 pm, Roberto wrote:
I have 10 possible ranges to create a cell value. I cannot use "IF" beyond 7
and I keep seeing suggestions to use "Lookup", but it's not working. I need
some examples if they're out there. Here's what I'm trying to do:

If the cell value in "X" is: <30, then value is 1
30-34 then value is 2
35-39 then value is 3
and so on..........




Mike

Multiple IF Function
 
Build a table

1 1
34 2
39 3
43 4
47 5
51 6
55 7
59 8
63 9
67 10

then
=VLOOKUP(A1,B1:C10,2,TRUE)



"Roberto" wrote:

I have 10 possible ranges to create a cell value. I cannot use "IF" beyond 7
and I keep seeing suggestions to use "Lookup", but it's not working. I need
some examples if they're out there. Here's what I'm trying to do:

If the cell value in "X" is: <30, then value is 1
30-34 then value is 2
35-39 then value is 3
and so on..........


T. Valko

Multiple IF Function
 
Another way:

=LOOKUP(A1,{0,1,30,35},{"",1,2,3})

Biff

"Roberto" wrote in message
...
I have 10 possible ranges to create a cell value. I cannot use "IF" beyond
7
and I keep seeing suggestions to use "Lookup", but it's not working. I
need
some examples if they're out there. Here's what I'm trying to do:

If the cell value in "X" is: <30, then value is 1
30-34 then value is 2
35-39 then value is 3
and so on..........




Roberto

Multiple IF Function
 
Piece of cake. Thanks to all.

"Roberto" wrote:

I have 10 possible ranges to create a cell value. I cannot use "IF" beyond 7
and I keep seeing suggestions to use "Lookup", but it's not working. I need
some examples if they're out there. Here's what I'm trying to do:

If the cell value in "X" is: <30, then value is 1
30-34 then value is 2
35-39 then value is 3
and so on..........



All times are GMT +1. The time now is 11:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com