Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2014, 09:24 AM
david_89_ david_89_ is offline IF + AND formula help Windows 7 64bit IF + AND formula help Office 2010 32bit
Novice
IF + AND formula help
 
Join Date: Mar 2014
Posts: 4
david_89_ is on a distinguished road
Default IF + AND formula help

Hi,

I am trying to build a formula which allows the following conditions:

the formula is on cell J2:

-if H2<0 and H2+I2<0, return H2
-if H2<0 and I2 is N/A, return H2
-if H2>0 and I2<0, return 0

so far I have bould the following but it is not working:

=IF(ISNA(I2),H2,IF(AND(H2>0,I2<0),0,IF(AND(H2<0),( H2+I2)<0),I2,(H2-I2)))

Thank you very much in advance.



Regards,
Reply With Quote
  #2  
Old 06-10-2014, 01:03 PM
gebobs gebobs is offline IF + AND formula help Windows 7 64bit IF + AND formula help Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Quote:
Originally Posted by david_89_ View Post
-if H2<0 and H2+I2<0, return H2
IF Condition THEN Result ELSE Alternative

You've given the Condition and the THEN Result but not the Else Alternative

Quote:
-if H2<0 and I2 is N/A, return H2
What is the relationship between the equations? Are they OR or AND? Or is the second equation the ELSE Alternative for the first?
Reply With Quote
  #3  
Old 06-10-2014, 03:48 PM
gebobs gebobs is offline IF + AND formula help Windows 7 64bit IF + AND formula help Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Quote:
Originally Posted by david_89_ View Post
=IF(ISNA(I2),H2,IF(AND(H2>0,I2<0),0,IF(AND(H2<0),( H2+I2)<0),I2,(H2-I2)))
What this will do is...

IF I2=NA() THEN H2
ELSEIF H2>0 AND I2<0 THEN 0
ELSEIF H2<0 AND H2+I2<0 THEN I2
ELSE H2-I2

I'm not surprised it doesn't work. :-)
Reply With Quote
  #4  
Old 06-11-2014, 06:53 AM
BobBridges's Avatar
BobBridges BobBridges is offline IF + AND formula help Windows 7 64bit IF + AND formula help Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

David, I agree with gebobs' diagnosis—that is, your IF formula does this:
Code:
       If          Then display
I2 is N/A                H2
H2>0 and I2<0            0
H2<0 and H2+I2<0         I2
else                   H2-I2
In your original post you described what you want and it's somewhat different. But maybe that doesn't matter; instead, tell me how it isn't working. What about the results don't you like?
Reply With Quote
  #5  
Old 06-11-2014, 11:07 AM
SarahBear SarahBear is offline IF + AND formula help Windows 7 32bit IF + AND formula help Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 13
SarahBear is on a distinguished road
Default

you were missing an open parenthese after your second and, but beyond that they are right, your formula won't return what you want.

Try:

=IF(AND(H2<0,(H2+I2)<0),H2,IF(AND(H2<0,ISNA(I2)),H 2,IF(AND(H2>0,I2<0),0,(H2-I2))))
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
IF + AND formula help Formula Help withersd46260 Excel 2 04-30-2014 08:33 AM
Formula Help - Look and if and that Corca Excel 2 02-05-2012 09:18 AM
IF + AND formula help help with formula? doczilla Excel 2 09-25-2011 04:14 PM
IF + AND formula help PMT Formula OneOleGuy Excel 4 03-05-2011 09:54 AM
IF + AND formula help If formula sixhobbits Excel 1 10-02-2009 08:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:57 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft