If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Combination of IF and AND

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-04, 11:07
SCOLE1464 SCOLE1464 is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Combination of IF and AND

Hi-
I am trying to have excel sum certain columns if another column = 1 and the sum of those columns is over a certain amount. I keep getting FALSE for the answer, so it must be missing the next argument. Any ideas?

=IF(AND(C3="1"),IF(H3>500,SUM(D3+E3+F3-500),IF(H3>250,SUM(D3+E3+F3-250)," ")))
Reply With Quote
  #2 (permalink)  
Old 02-02-04, 11:23
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
A couple of things:

Take out the " around 1, since it is a number (only text requires the quotes).

Also, your AND function does not include the second condition. You have too many IF's

Can you elaborate a little more on what you are trying to accomplish?

[EDIT:

Is this what you want?

=IF(AND((C3=1)*(H3>500)),D3+E3+F3-500,IF(AND((C3=1)*(H3>250)*(H3<500)),D3+E3+F3-250,""))


BTW, the space between the last set of quotes should be deleted if you want nothing to show.

On second edit, I think this will achieve what you want.
[/EDIT]
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums

Last edited by shades; 02-02-04 at 11:37.
Reply With Quote
  #3 (permalink)  
Old 02-02-04, 11:52
SCOLE1464 SCOLE1464 is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Thanks for the help. I really appreciate it.

Basically, I want Excel to put in the differenct between the sum of D3+E3+F3 and 500 if the sum of D3+E3+F3 is greater than 500 and the value of C3 = 1. If C3 <> 1 I want excel to put in the difference between the sum of D3+E3+F3 and 250 if the sum of D3+E3+F3 is greater than 250. SO it needs to check two things, 1) what C is equal to, and 2) what is the value of D3+E3+F3 and is it greater than X.




Quote:
Originally posted by shades
A couple of things:

Take out the " around 1, since it is a number (only text requires the quotes).

Also, your AND function does not include the second condition. You have too many IF's

Can you elaborate a little more on what you are trying to accomplish?

[EDIT:

Is this what you want?

=IF(AND((C3=1)*(H3>500)),D3+E3+F3-500,IF(AND((C3=1)*(H3>250)*(H3<500)),D3+E3+F3-250,""))


BTW, the space between the last set of quotes should be deleted if you want nothing to show.

On second edit, I think this will achieve what you want.
[/EDIT]
Reply With Quote
  #4 (permalink)  
Old 02-02-04, 12:06
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Try this:

=IF(AND((C3=1)*(D3+E3+F3)>500),D3+E3+F3-500,IF(AND(C3<>1)*((D3+E3+F3)>250),D3+E3+F3-250,""))
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #5 (permalink)  
Old 02-02-04, 14:18
SCOLE1464 SCOLE1464 is offline
Registered User
 
Join Date: Feb 2004
Posts: 3
Thanks!

Thanks so much! I was going in circles...


Quote:
Originally posted by shades
Try this:

=IF(AND((C3=1)*(D3+E3+F3)>500),D3+E3+F3-500,IF(AND(C3<>1)*((D3+E3+F3)>250),D3+E3+F3-250,""))
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On