Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default I can not seem to get my IF / AND statement to work, help please

This is my IF / AND statement that I can not get to work.
(=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3))),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J 3)),IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3))).
Does any one have any suggestions to what I am doing incorrectly?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default I can not seem to get my IF / AND statement to work, help please

See if this is what you want. Note: Your last IF statement does not appear
to have a FALSE conditions. In other words, what should it do if it is
False?

=IF(AND(D3="yes",E3="",K3="M"),G3-I3-(H3+I3+J3),IF(AND(D3="yes",E3="",K3="L"),G3-I3-J3,IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J3), IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3))))

HTH,
Paul


--

"petester" wrote in message
...
This is my IF / AND statement that I can not get to work.
(=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3))),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J 3)),IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3))).
Does any one have any suggestions to what I am doing incorrectly?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default I can not seem to get my IF / AND statement to work, help please

You need to check the matching of the parentheses for each IF statement, and
you need to ensure that each IF has 3 arguments (or not more than 3; you
can get away with 2, but in that case the default would return FALSE for the
unspecified condition).

I've tried to correct your formula without knowing what you're trying to
achieve, but at least to give it valid syntax. I got:
=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J3) ,IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3,"unspecifi ed
output"))))
You could lose a few parentheses to make the counting easier:
=IF(AND(D3="yes",E3="",K3="M"),G3-I3-(H3+I3+J3),IF(AND(D3="yes",E3="",K3="L"),G3-I3-J3,IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J3), IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3,"unspecifie d
output"))))

You might find it clearer if you group situations like
=IF(AND(D3="yes",E3="")... and then separate your K3 conditions after that.
--
David Biddulph

"petester" wrote in message
...
This is my IF / AND statement that I can not get to work.
(=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3))),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J 3)),IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3))).
Does any one have any suggestions to what I am doing incorrectly?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default I can not seem to get my IF / AND statement to work, help plea

Thank you! The rewrite with fewer parentheses did the trick.

"David Biddulph" wrote:

You need to check the matching of the parentheses for each IF statement, and
you need to ensure that each IF has 3 arguments (or not more than 3; you
can get away with 2, but in that case the default would return FALSE for the
unspecified condition).

I've tried to correct your formula without knowing what you're trying to
achieve, but at least to give it valid syntax. I got:
=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J3) ,IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3,"unspecifi ed
output"))))
You could lose a few parentheses to make the counting easier:
=IF(AND(D3="yes",E3="",K3="M"),G3-I3-(H3+I3+J3),IF(AND(D3="yes",E3="",K3="L"),G3-I3-J3,IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J3), IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3,"unspecifie d
output"))))

You might find it clearer if you group situations like
=IF(AND(D3="yes",E3="")... and then separate your K3 conditions after that.
--
David Biddulph

"petester" wrote in message
...
This is my IF / AND statement that I can not get to work.
(=IF(AND(D3="yes",E3="",K3="M"),(G3-I3-(H3+I3+J3)),IF(AND(D3="yes",E3="",K3="L"),(G3-I3-J3))),IF(AND(D3="",E3="yes",K3="M"),G3+H3+(H3+I3+J 3)),IF(AND(D3="",E3="yes",K3="L"),G3+H3+J3))).
Does any one have any suggestions to what I am doing incorrectly?




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
My IF statement won't work for my formula AdzRay Excel Worksheet Functions 5 February 3rd 07 10:51 PM
How do I get an IS and IF statement to work together in excel? Heaths99 Excel Worksheet Functions 3 June 8th 06 02:38 PM
Anyone actually get Case statement to work ... ? ForestFeeder Excel Worksheet Functions 3 April 21st 06 04:14 PM
Why doesn't this nested IF statement work? Brandoni Excel Worksheet Functions 4 April 19th 06 10:26 PM
Array If statement doesn't work Suzanne Excel Worksheet Functions 5 December 3rd 04 09:19 AM


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