Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lee
 
Posts: n/a
Default IF & OR Functions

Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion of the
IF function. I just need to know how to group them together, without having a
long nested IF function,

By the way is there a limit to have many nested IF functions are allowed?
  #2   Report Post  
RagDyer
 
Posts: n/a
Default

What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...
Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion of

the
IF function. I just need to know how to group them together, without

having a
long nested IF function,

By the way is there a limit to have many nested IF functions are allowed?


  #3   Report Post  
Lee
 
Posts: n/a
Default

The part you wrote worked great. This is the whole IF function

=IF(OR('A-V Input'!A5={"HS-U","HS-D","HS-R","HS-L"}),"U-MHU-MCS",IF('A-V
Input'!A5="H","U-MHU",IF('A-V Input'!A5="ST-C","U-MCS-W",IF('A-V
Input'!A5="ST","U-MCS",IF('A-V Input'!A5="HS-C","U-MHU-MCS","-")))))

It works the way I wanted. If you can shorten it up feel free I am open to
suggestions

Thanks alot



"RagDyer" wrote:

What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...
Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion of

the
IF function. I just need to know how to group them together, without

having a
long nested IF function,

By the way is there a limit to have many nested IF functions are allowed?



  #4   Report Post  
gls858
 
Posts: n/a
Default

Lee wrote:
The part you wrote worked great. This is the whole IF function

=IF(OR('A-V Input'!A5={"HS-U","HS-D","HS-R","HS-L"}),"U-MHU-MCS",IF('A-V
Input'!A5="H","U-MHU",IF('A-V Input'!A5="ST-C","U-MCS-W",IF('A-V
Input'!A5="ST","U-MCS",IF('A-V Input'!A5="HS-C","U-MHU-MCS","-")))))

It works the way I wanted. If you can shorten it up feel free I am open to
suggestions

Thanks alot



"RagDyer" wrote:


What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...

Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion of


the

IF function. I just need to know how to group them together, without


having a

long nested IF function,

By the way is there a limit to have many nested IF functions are allowed?




Limit to nested if statements. Took this from Help file:

Up to seven IF functions can be nested as value_if_true and value_if_false
arguments to construct more elaborate tests. (See Example 3 for a sample of
nested IF functions.) If you want to test more than seven conditions,
consider using the LOOKUP, VLOOKUP, or HLOOKUP function. (See Example 4 for
a sample of the LOOKUP function.)

gls858
  #5   Report Post  
Lee
 
Posts: n/a
Default

Thanks alot I will try it

"gls858" wrote:

Lee wrote:
The part you wrote worked great. This is the whole IF function

=IF(OR('A-V Input'!A5={"HS-U","HS-D","HS-R","HS-L"}),"U-MHU-MCS",IF('A-V
Input'!A5="H","U-MHU",IF('A-V Input'!A5="ST-C","U-MCS-W",IF('A-V
Input'!A5="ST","U-MCS",IF('A-V Input'!A5="HS-C","U-MHU-MCS","-")))))

It works the way I wanted. If you can shorten it up feel free I am open to
suggestions

Thanks alot



"RagDyer" wrote:


What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...

Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion of

the

IF function. I just need to know how to group them together, without

having a

long nested IF function,

By the way is there a limit to have many nested IF functions are allowed?



Limit to nested if statements. Took this from Help file:

Up to seven IF functions can be nested as value_if_true and value_if_false
arguments to construct more elaborate tests. (See Example 3 for a sample of
nested IF functions.) If you want to test more than seven conditions,
consider using the LOOKUP, VLOOKUP, or HLOOKUP function. (See Example 4 for
a sample of the LOOKUP function.)

gls858



  #6   Report Post  
RagDyeR
 
Posts: n/a
Default

Right off the bat, unless you have a typo, you can eliminate the *last*
argument and add it to the *first* "OR" argument.

The way to really shorten the formula is to create a data list, and
construct a formula to reference the list.
You can place this list in an out-of-the-way location of your sheet, say Y1
to Z8.
Y Z

H U-MHU
HS-C U-MHU-MCS
HS-D U-MHU-MCS
HS-L U-MHU-MCS
HS-R U-MHU-MCS
HS-U U-MHU-MCS
ST U-MCS
ST-C U-MCS-W


Then your formula could look something like this:

=LOOKUP('A-V Input'!A5,Y1:Z8)

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Lee" wrote in message
...
The part you wrote worked great. This is the whole IF function

=IF(OR('A-V Input'!A5={"HS-U","HS-D","HS-R","HS-L"}),"U-MHU-MCS",IF('A-V
Input'!A5="H","U-MHU",IF('A-V Input'!A5="ST-C","U-MCS-W",IF('A-V
Input'!A5="ST","U-MCS",IF('A-V Input'!A5="HS-C","U-MHU-MCS","-")))))

It works the way I wanted. If you can shorten it up feel free I am open to
suggestions

Thanks alot



"RagDyer" wrote:

What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...
Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion

of
the
IF function. I just need to know how to group them together, without

having a
long nested IF function,

By the way is there a limit to have many nested IF functions are

allowed?




  #7   Report Post  
RagDyeR
 
Posts: n/a
Default


I really screwed up the format with the paste.
Hope this looks better.

Y Z

1 H U-MHU
2 HS-C U-MHU-MCS
3 HS-D U-MHU-MCS
4 HS-L U-MHU-MCS
5 HS-R U-MHU-MCS
6 HS-U U-MHU-MCS
7 ST U-MCS
8 ST-C U-MCS-W

The *main* point here is that the list should be *sorted*.

So, follow the above.
--

Regards,

RD
----------------------------------------------------------------------------
-------------------
Please keep all correspondence within the Group, so all may benefit !
----------------------------------------------------------------------------
-------------------

"RagDyeR" wrote in message
...
Right off the bat, unless you have a typo, you can eliminate the *last*
argument and add it to the *first* "OR" argument.

The way to really shorten the formula is to create a data list, and
construct a formula to reference the list.
You can place this list in an out-of-the-way location of your sheet, say Y1
to Z8.
Y Z

H U-MHU
HS-C U-MHU-MCS
HS-D U-MHU-MCS
HS-L U-MHU-MCS
HS-R U-MHU-MCS
HS-U U-MHU-MCS
ST U-MCS
ST-C U-MCS-W


Then your formula could look something like this:

=LOOKUP('A-V Input'!A5,Y1:Z8)

--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===


"Lee" wrote in message
...
The part you wrote worked great. This is the whole IF function

=IF(OR('A-V Input'!A5={"HS-U","HS-D","HS-R","HS-L"}),"U-MHU-MCS",IF('A-V
Input'!A5="H","U-MHU",IF('A-V Input'!A5="ST-C","U-MCS-W",IF('A-V
Input'!A5="ST","U-MCS",IF('A-V Input'!A5="HS-C","U-MHU-MCS","-")))))

It works the way I wanted. If you can shorten it up feel free I am open to
suggestions

Thanks alot



"RagDyer" wrote:

What's supposed to happen when there is no match?

Anyway, try this:

=IF(OR(A1={"HS-U","HS-D","HS-R","HS-L"}),"U-HS-MCS","No Match")
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



"Lee" wrote in message
...
Can you use a OR function in an IF function.

I'm trying to check a cell on sheet 1 for certain text such as
"HS-C"
"HS-U"
"HS-D"
"HS-R"
"HS-L"
"HS"
"ST-C"
"ST"

if the cell has "HS-L" or "HS-U" or"HS-D" or"HS-R" the IF function would
return "U-HS-MCS, I could probally nest the others in the False setion

of
the
IF function. I just need to know how to group them together, without

having a
long nested IF function,

By the way is there a limit to have many nested IF functions are

allowed?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visible rows and functions that work tracy Excel Worksheet Functions 2 August 19th 05 05:25 AM
Improvements for text finding functions yarp Excel Discussion (Misc queries) 2 August 8th 05 04:01 PM
Default User Defined Functions - How? flycast Excel Discussion (Misc queries) 4 May 26th 05 04:26 AM
PASTE DOWN FUNCTIONS jackle Excel Worksheet Functions 0 May 25th 05 02:10 PM
# of Functions per cell SUB-ZERO Excel Worksheet Functions 3 January 23rd 05 10:35 PM


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"