Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default combining IF OR Functions

I am trying to combine the following if functions with an or funtion which
will provide mw with the answer 6,10,14,21 or 25.
=IF($AG$2="3-6","6", "Not OK")
=IF($AG$3="7-10","10", "Not OK")
=IF($AG$4="11-14","14", "Not OK")
=IF($AG$5="18-21","21", "Not OK")
=IF($AG$6="22-25","25", "Not OK")

My attempts so far are futile. Can anyone help?

Thanks


--
kevan
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default combining IF OR Functions

kevan wrote:
I am trying to combine the following if functions with an or funtion which
will provide mw with the answer 6,10,14,21 or 25.
=IF($AG$2="3-6","6", "Not OK")
=IF($AG$3="7-10","10", "Not OK")
=IF($AG$4="11-14","14", "Not OK")
=IF($AG$5="18-21","21", "Not OK")
=IF($AG$6="22-25","25", "Not OK")


Hi kevan,

Be aware when you use double-ticks in a formula like =IF($AG$2="3-6" you
are asking if AG2 literally contains the text 3-6. If AG2 has a proper
number in it like 5 the IF statement will always be false.

You could try a formula like

=IF(AND($AG$2=3,$AG$2<=6),6,"Not OK")

Note this formula also outputs the /number/ 6, not a text result of "6".
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default combining IF OR Functions

Hi,

There may be a logic error here, if AG2 does not contain 3-6 the formula
returns "Not OK". Once that is done the function would not go on to check
AG3. If it did it would return something like Not OK, Not OK, Not OK, 21,
Not OK. Would you really want all those answers. Here is probably what you
want:

=IF($AG$2="3-6",6,IF($AG$3="7-10",10,IF($AG$4="11-14",14,IF($AG$5="18-21",21,IF($AG$6="22-25",25, "Not OK")))))

You don't need to quote numbers so I took those quotes out.
--
Thanks,
Shane Devenshire


"kevan" wrote:

I am trying to combine the following if functions with an or funtion which
will provide mw with the answer 6,10,14,21 or 25.
=IF($AG$2="3-6","6", "Not OK")
=IF($AG$3="7-10","10", "Not OK")
=IF($AG$4="11-14","14", "Not OK")
=IF($AG$5="18-21","21", "Not OK")
=IF($AG$6="22-25","25", "Not OK")

My attempts so far are futile. Can anyone help?

Thanks


--
kevan

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default combining IF OR Functions

Thanks Shane it worked perfectly once I had corrected my own error about cell
numbers....

=IF($AG2="3-6",6,IF($AG2="7-10",10,IF($AG2="11-14",14,IF($AG2="18-21",21,IF($AG2="22-25",25, "Not OK")))))

Thanks again
--
kevan


"ShaneDevenshire" wrote:

Hi,

There may be a logic error here, if AG2 does not contain 3-6 the formula
returns "Not OK". Once that is done the function would not go on to check
AG3. If it did it would return something like Not OK, Not OK, Not OK, 21,
Not OK. Would you really want all those answers. Here is probably what you
want:

=IF($AG$2="3-6",6,IF($AG$3="7-10",10,IF($AG$4="11-14",14,IF($AG$5="18-21",21,IF($AG$6="22-25",25, "Not OK")))))

You don't need to quote numbers so I took those quotes out.
--
Thanks,
Shane Devenshire


"kevan" wrote:

I am trying to combine the following if functions with an or funtion which
will provide mw with the answer 6,10,14,21 or 25.
=IF($AG$2="3-6","6", "Not OK")
=IF($AG$3="7-10","10", "Not OK")
=IF($AG$4="11-14","14", "Not OK")
=IF($AG$5="18-21","21", "Not OK")
=IF($AG$6="22-25","25", "Not OK")

My attempts so far are futile. Can anyone help?

Thanks


--
kevan

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default combining IF OR Functions

Hi Kevan,

Well that makes a lot more sense to me,

Good luck.
Shane

"kevan" wrote in message
...
Thanks Shane it worked perfectly once I had corrected my own error about
cell
numbers....

=IF($AG2="3-6",6,IF($AG2="7-10",10,IF($AG2="11-14",14,IF($AG2="18-21",21,IF($AG2="22-25",25,
"Not OK")))))

Thanks again
--
kevan


"ShaneDevenshire" wrote:

Hi,

There may be a logic error here, if AG2 does not contain 3-6 the formula
returns "Not OK". Once that is done the function would not go on to check
AG3. If it did it would return something like Not OK, Not OK, Not OK,
21,
Not OK. Would you really want all those answers. Here is probably what
you
want:

=IF($AG$2="3-6",6,IF($AG$3="7-10",10,IF($AG$4="11-14",14,IF($AG$5="18-21",21,IF($AG$6="22-25",25,
"Not OK")))))

You don't need to quote numbers so I took those quotes out.
--
Thanks,
Shane Devenshire


"kevan" wrote:

I am trying to combine the following if functions with an or funtion
which
will provide mw with the answer 6,10,14,21 or 25.
=IF($AG$2="3-6","6", "Not OK")
=IF($AG$3="7-10","10", "Not OK")
=IF($AG$4="11-14","14", "Not OK")
=IF($AG$5="18-21","21", "Not OK")
=IF($AG$6="22-25","25", "Not OK")

My attempts so far are futile. Can anyone help?

Thanks


--
kevan


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
Combining Functions MikeM Excel Discussion (Misc queries) 5 October 16th 08 02:31 PM
combining IF, AND, and OR Functions Hillary: needing some help[_2_] Excel Worksheet Functions 5 October 9th 08 04:37 PM
Combining Functions MikeM Excel Discussion (Misc queries) 3 September 30th 08 04:52 PM
Combining IF and OR Functions ConfusedNHouston Excel Discussion (Misc queries) 2 October 4th 06 12:38 AM
Combining IF OR and AND functions andyp161 Excel Worksheet Functions 3 April 20th 06 06:05 PM


All times are GMT +1. The time now is 12:20 AM.

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

About Us

"It's about Microsoft Excel"