Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Bob is offline
external usenet poster
 
Posts: 972
Default IF AND statements

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default IF AND statements

Try
=IF(OR(G2="a",G2="a3",G2="m",G2="m3",G2="ftm"),IF( AND(H2="",K2=""),0.5,1),"No match")

or the longer version
=IF(AND(OR(G2="a",G2="a3",G2="m",G2="m3",G2="ftm") ,H2="",K2=""),0.5,IF(AND(OR(G2="a",G2="a3",G2="m", G2="m3",G2="ftm"),OR(H2<"",K2<"")),1,"No match"))

"bob" wrote:

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF AND statements

Maybe

=IF(AND(OR(G2="a",G2="a3",G2="m",G2="ftm"),H2<"", K2<""),0.5,1)

Mike

"bob" wrote:

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF AND statements

=IF(OR(G2="a",G2="a3",G2="m",G2="m3",G2="ftm"),IF( H2<"",IF(K2<"",0.5,1),IF(K2<"",1,"H2
and K2 both blank so answer undefined")),"G2 not one of specified values so
answer undefined")
--
David Biddulph

"bob" wrote in message
...
I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default IF AND statements

An alternative to David's formula:
=IF(AND(OR(G2={"a","a3","m","m3","ftm"})+0,OR(H2< "",K2<"")),1/((H2<"")+(K2<"")),"unmatched")

The other 2 formulas offered so far (S & MH), fail in certain areas).
--
** John C **


"bob" wrote:

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default IF AND statements

Do you need the +0 ?
--
David Biddulph

"John C" <johnc@stateofdenial wrote in message
...
An alternative to David's formula:
=IF(AND(OR(G2={"a","a3","m","m3","ftm"})+0,OR(H2< "",K2<"")),1/((H2<"")+(K2<"")),"unmatched")

The other 2 formulas offered so far (S & MH), fail in certain areas).
--
** John C **


"bob" wrote:

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default IF AND statements

Nope. Early version, I thought I did, and just never got rid of it. Kind of
interesting, checkmarks go to the other 2 respondents, when the formulas
don't match OP's request, lol.
--
** John C **

"David Biddulph" wrote:

Do you need the +0 ?
--
David Biddulph

"John C" <johnc@stateofdenial wrote in message
...
An alternative to David's formula:
=IF(AND(OR(G2={"a","a3","m","m3","ftm"})+0,OR(H2< "",K2<"")),1/((H2<"")+(K2<"")),"unmatched")

The other 2 formulas offered so far (S & MH), fail in certain areas).
--
** John C **


"bob" wrote:

I'm seeking a formula for the following problem:

IF G2 = "a" or "a3" or "m" or "m3" or "ftm"
AND H2 and K2 are populated with any value (that is, they are not blank
cells),
then the formula should return a value of 0.5

BUT if the G2 equals any of the above values
AND H2 is populated with any value
AND K2 is blank (has nothing in the cell),
then the formula should return a value of 1

BUT if the G2 equals any of the above values
AND K2 is populated with any value
AND H2 is blank (has nothing in the cell),
then the formula should return a value of 1

Can anyone help?

many thanks,
Bob




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
if then statements doug Excel Discussion (Misc queries) 1 November 25th 07 07:44 PM
IF Statements (Mutliple Statements) Deezel Excel Worksheet Functions 3 October 19th 06 06:13 AM
IF and OR statements Loraloo Excel Discussion (Misc queries) 3 March 4th 06 11:42 PM
More than 7 IF(AND) statements alexm999 Excel Discussion (Misc queries) 3 August 12th 05 12:00 PM
If Statements... Delaina Excel Discussion (Misc queries) 4 August 1st 05 10:29 PM


All times are GMT +1. The time now is 11:52 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"