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 Nested IF statements using AND / OR

I have successfully nested IF statement in the past, but my current task is
frustrating me. I want to test for two conditions. if both are present, I
want the results of a cell's value to X.

If both aren't present, I want to test for a third condition. If the third
condition is present, I want the cell's value to also be X.

If neither the two conditions exist or the one condtion exists, I want the
cell to display Y.

Here is what my formula looks like

=IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),""))

The first part, the logical statement is coming back invalid.

Can someone help? Thanks.
--
Joe Schwartz
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Nested IF statements using AND / OR

AND (as well as OR, MOD, etc.) is not an operator as it is in most
programming languages... it is a function. So when you wrote this...

(D1415) AND (G14="Y")

it should have been this...

AND(D1415,G14="Y")

--
Rick (MVP - Excel)


"Joe" (donotspam) wrote in message
...
I have successfully nested IF statement in the past, but my current task is
frustrating me. I want to test for two conditions. if both are present,
I
want the results of a cell's value to X.

If both aren't present, I want to test for a third condition. If the
third
condition is present, I want the cell's value to also be X.

If neither the two conditions exist or the one condtion exists, I want the
cell to display Y.

Here is what my formula looks like

=IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),""))

The first part, the logical statement is coming back invalid.

Can someone help? Thanks.
--
Joe Schwartz


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Nested IF statements using AND / OR

Syntax for AND is
AND(test1, test2, test3, ....)

Your formula rewritten:
=IF(OR(C140.8,AND(D1415,G14="Y"),(I14*N14)/12),"Y")

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Joe" wrote:

I have successfully nested IF statement in the past, but my current task is
frustrating me. I want to test for two conditions. if both are present, I
want the results of a cell's value to X.

If both aren't present, I want to test for a third condition. If the third
condition is present, I want the cell's value to also be X.

If neither the two conditions exist or the one condtion exists, I want the
cell to display Y.

Here is what my formula looks like

=IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),""))

The first part, the logical statement is coming back invalid.

Can someone help? Thanks.
--
Joe Schwartz

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
Too Many Nested IF Statements! Tiziano Excel Worksheet Functions 5 October 3rd 07 02:29 AM
Nested IF statements maacmaac Excel Discussion (Misc queries) 3 January 24th 06 12:00 AM
Nested IF statements maacmaac Excel Discussion (Misc queries) 0 January 23rd 06 09:22 PM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM
Do I need nested IF statements? Jaramya Excel Worksheet Functions 1 November 5th 04 09:10 PM


All times are GMT +1. The time now is 11:05 PM.

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"