ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   combine or if (https://www.excelbanter.com/excel-worksheet-functions/193961-combine-if.html)

littlelouise1

combine or if
 
I need to check for three (or more conditions) and need a different value
returned for each criteria.

For example:
DATA Wanted result:
1 Single
2 Dual
4 Quad

My mistake lies in formatting of the formula:
If(A1=1, "Single")or if(A1=2, "Dual") or if (A1=4, "Quad")


-aimes

Peo Sjoblom[_2_]

combine or if
 
You can use

=VLOOKUP(A1,{1,"Single";2,"Dual";3,"Quad"},2,0)

which is handy especially if you use more than 3, or

=CHOOSE(A1,"Single","Dual","Quad")


if you insist using IF


=IF(A1=1,"Single",IF(A1=2,"Dual","Quad"))

assuiming thatn there cannot be any other values than 1,2,3

--


Regards,


Peo Sjoblom

"littlelouise1" wrote in message
...
I need to check for three (or more conditions) and need a different value
returned for each criteria.

For example:
DATA Wanted result:
1 Single
2 Dual
4 Quad

My mistake lies in formatting of the formula:
If(A1=1, "Single")or if(A1=2, "Dual") or if (A1=4, "Quad")


-aimes




Gary Brown[_4_]

combine or if
 
=IF(A1=1, "Single",IF(A1=2, "Dual",IF(A1=4, "Quad","")))
--
Hope this helps.
If this post was helpfull, please remember to click on the ''''YES''''
button at the bottom of the screen.
Thanks,
Gary Brown


"littlelouise1" wrote:

I need to check for three (or more conditions) and need a different value
returned for each criteria.

For example:
DATA Wanted result:
1 Single
2 Dual
4 Quad

My mistake lies in formatting of the formula:
If(A1=1, "Single")or if(A1=2, "Dual") or if (A1=4, "Quad")


-aimes


Pete_UK

combine or if
 
You need to construct your formula like this:

=IF(A1=1,"Single",IF(A1=2,"Dual",IF(A1=4,"Quad","n one")))

Will return the message "none" if A1 does not contain 1, 2 or 4.

You can combine IF functions like this (referred to as nesting) up to
a maximum of 7 if you have XL2003 or earlier. An alternative way if
you have more than 7 criteria is to use VLOOKUP, or you could use
CHOOSE if your numbers are consecutive.

Hope this helps.

Pete

On Jul 7, 6:28*pm, littlelouise1
wrote:
I need to check for three (or more conditions) and need a different value
returned for each criteria.

For example:
DATA * * * Wanted result:
1 * * * * * * Single
2 * * * * * * Dual
4 * * * * * * Quad

My mistake lies in formatting of the formula:
If(A1=1, "Single")or if(A1=2, "Dual") or if (A1=4, "Quad")

-aimes



Dave Peterson

combine or if
 
I'd create a table on another sheet that's dedicated to just that info.

Then I'd use:

=vlookup(a1,Type!a:b,2,false)

where that table was in A1:B### on a sheet named Type.

If I have to add more entries--or even change some, I find this easier to
update.


littlelouise1 wrote:

I need to check for three (or more conditions) and need a different value
returned for each criteria.

For example:
DATA Wanted result:
1 Single
2 Dual
4 Quad

My mistake lies in formatting of the formula:
If(A1=1, "Single")or if(A1=2, "Dual") or if (A1=4, "Quad")

-aimes


--

Dave Peterson


All times are GMT +1. The time now is 03:06 PM.

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