Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default IF statement with AND or OR?

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF statement with AND or OR?

Colin,

Try this:-

=IF(A1+A2=0,"Pass",IF(A1=0,"Dropped",IF(A20,"Fail ","Unspecified")))

A1=2
A2=0
Hence unspecified.

Mike

"Colin" wrote:

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,345
Default IF statement with AND or OR?

Try:

=IF(A10,"Dropped",IF(A20,"Fail","Pass"))

However this will return Pass id both cells are empty

To avoid this use:

=IF(OR(A1="",A2=""),"",IF(A10,"Dropped",IF(A20," Fail","Pass")))

This still assumes that no cell will hold a negative value.


--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Colin" wrote in message
...
Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and
"Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0
in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF statement with AND or OR?

Oops,

try this instead

=IF(A1+A2=0,"Pass",IF(A10,"Dropped",IF(A20,"Fail ","Unspecified")))

Same comment about unspecified bit for a different reason

A1=-1
A2=0


Mike

"Colin" wrote:

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default IF statement with AND or OR?

It's been a long day!!

My final effort because I overlooked that -1+1=0

=IF(AND(A1=0,A2=0),"Pass",IF(A10,"Dropped",IF(A2 0,"Fail","Unspecified")))

Mike

"Colin" wrote:

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default IF statement with AND or OR?

Hi Colin

=IF(COUNT(A1,A2)<2,"",IF(A10,"Dropped",
IF(A20,"Fail",IF(A1+A2=0,"Pass","Other"))))

--
Regards
Roger Govier



"Colin" wrote in message
...
Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and
"Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0
in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IF statement with AND or OR?

=IF(AND(A1=0,A2=0),"Pass",IF(A10,"Dropped","Fail" ))


"Colin" wrote:

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default IF statement with AND or OR?

Hi everyone,

So many ways to accomplish the same result!
Many thanks to all of you for your swift responses.

--
Thank you,

Colin.


"Teethless mama" wrote:

=IF(AND(A1=0,A2=0),"Pass",IF(A10,"Dropped","Fail" ))


"Colin" wrote:

Hi,

I have a range of cells a1:a3.
In a1 I will have a number between 0 - 5.
In a2 I will have a number between 0 - 5.
In a3 I want a function that returns "Fail" if a2 is above 0, and "Dropped"
if a1 is above 0 irrelevant to what number is in a2. ie: a number above 0 in
a1 will always return "Dropped" no matter what number is a2.
If a1 and a2 are both at 0 then "Pass" will be returned.

My starting point is =IF(A20,"Fail","Pass").

Please can you help?
--
Thank you,

Colin.

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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
IF statement piglett51 Excel Worksheet Functions 1 September 15th 05 07:01 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


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