Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default how to combine and's with or's in a if statement

If "A" is constant for both or conditions, how does one write the if
statement? I tried to do this and got and error:
If(or($b4="UA", sum($r4+$t40, and($a4="S")),1,2)
--
Rick Rack
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default how to combine and's with or's in a if statement

Hi Rick,

You have a syntax error (missing closing parenthesis): sum($r4+$t40
correct: sum($r4+$t4)0

But I can't tell wether your formula gives the result you want, because you
don't tell us what you want exactly!

Regards,
Stefi

€žRick€ť ezt Ă*rta:

If "A" is constant for both or conditions, how does one write the if
statement? I tried to do this and got and error:
If(or($b4="UA", sum($r4+$t40, and($a4="S")),1,2)
--
Rick Rack

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default how to combine and's with or's in a if statement

Rick,
Is this what you require?

=IF(AND(OR($B4="UA",$R4+$T40), ($A4="S")),1,2)

If B4="UA OR R4+T40 AND A4="S" then results is 1, otherwise 2

"Rick" wrote:

If "A" is constant for both or conditions, how does one write the if
statement? I tried to do this and got and error:
If(or($b4="UA", sum($r4+$t40, and($a4="S")),1,2)
--
Rick Rack

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default how to combine and's with or's in a if statement

maybe

=IF(OR($B4="UA",AND($R4+$T40,$A4="S")),1,2)

but where is A constant?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Rick" wrote in message
...
If "A" is constant for both or conditions, how does one write the if
statement? I tried to do this and got and error:
If(or($b4="UA", sum($r4+$t40, and($a4="S")),1,2)
--
Rick Rack



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
combine if(and statement [email protected] Excel Worksheet Functions 4 March 10th 09 03:07 PM
Nesting IF's and AND's - a bit of help please... neilcarden Excel Worksheet Functions 2 September 19th 07 10:10 AM
IF's & AND's Dave Excel Discussion (Misc queries) 1 September 4th 07 12:08 PM
SUMPRODUCT with AND's and OR's? Ronny Hamida Excel Worksheet Functions 3 July 10th 06 10:57 PM
long IF statement with lots of OR's René Excel Programming 2 July 21st 03 07:04 PM


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

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"