+ Reply to Thread
Results 1 to 19 of 19

Multiple If conditions, AND formula help needed

  1. #1
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Multiple If conditions, AND formula help needed

    Kindly refer attachment SalesTGT.xls

    I have 3 cells B2, B5, D5 with some values. I like to get results in cell F4 based on following conditions.

    conditions
    1. If B2>B5 & D5="NEW", F4 = 0, If B2>B5 & D5="OLD", F4 = B2-B5
    2. If B2<B5 & D5="NEW", F4 = B5-B2, If B2<B5 & D5="OLD", F4 = 0

    I wish to get both conditions solved in one formula.

    I tried nested if method and unable to get desired results.
    someone pls help me.
    Attached Files Attached Files
    Last edited by jilaba; 01-13-2022 at 01:42 PM.
    Ask me how to hate XL.

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Multiple If conditions, AND formula help needed

    Is that the correct attachment? B5 is blank, D5 is blank, B2 has the value 20000. Also, will D5 *always* be "NEW" or "OLD" - no other values? Also what happens if B2=B5?

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Multiple If conditions, AND formula help needed

    Posted the wrong file (??) as data does not match your requirements.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by WideBoyDixon View Post
    Is that the correct attachment? B5 is blank, D5 is blank, B2 has the value 20000. Also, will D5 *always* be "NEW" or "OLD" - no other values? Also what happens if B2=B5?

    WBD
    Thanks for your time. I corrected and uploaded again.
    D5 will either be NEW or OLD only. B2 will never be equal to B5. Both D5 & B2 will be having value restricted entries.

  5. #5
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by JohnTopley View Post
    Posted the wrong file (??) as data does not match your requirements.
    sorry, I posted right file now. Thanks.

  6. #6
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Multiple If conditions, AND formula help needed

    I'm going to have to assume you mean B1, not B2:

    Please Login or Register  to view this content.
    WBD

  7. #7
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by WideBoyDixon View Post
    I'm going to have ...

    WBD
    You are right, ITs B1 only. Sorry for that. It solved my first condition thing only. Thanks
    Last edited by jilaba; 01-13-2022 at 01:55 PM.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Multiple If conditions, AND formula help needed

    Try

    =IF(D5="NEW",MAX(0,B5-B1),MAX(0,B1-B5))

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Multiple If conditions, AND formula help needed

    Maybe try

    =MAX(0,(B1-B5)*(2*(D5="old")-1))

    or
    =MAX(0,IF(D5="Old",B1-B5,B5-B1))

    Work.jpg
    Attached Files Attached Files
    Last edited by Bo_Ry; 01-13-2022 at 02:08 PM.

  10. #10
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by JohnTopley View Post
    Try ...
    Thanks for your time., But not workng.
    Last edited by jilaba; 01-13-2022 at 01:53 PM.

  11. #11
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by WideBoyDixon View Post
    I'm going to have to;;;;;; WBD
    It solved my condition 1. For condition 2, i do not know to club it with condition 1's formula. Pls help me. Thanks
    Last edited by jilaba; 01-13-2022 at 01:53 PM.

  12. #12
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by Bo_Ry View Post
    Maybe try
    Thanks, but not working.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Multiple If conditions, AND formula help needed

    Try this...

    =IF(AND(B2>B5,D5="Old"),B2-B5,IF(AND(B2<B5,D5="Old"),0,IF(AND(B2>B5,D5="New"),0,IF(AND(B2<B5,D5="New"),B5-B2,0))))
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Multiple If conditions, AND formula help needed

    What is not working ????

    B1=20000 B5=14000, D5="NEW" , F4=0: D5=OLD"", F5=6000 (B1> B5)

    b1=12000, b5=14000, D5="NEW", f4=2000, d5="OLD", F4=0 (B1 < B5)

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Multiple If conditions, AND formula help needed

    JT... I think part of the story is missing. We'll see....

  16. #16
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by Glenn Kennedy View Post
    Try this...
    Thanks a lot, it solved my thing.

  17. #17
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by Bo_Ry View Post
    Maybe try ...
    Extremly sorry, It was so simple and solved. In fact - i overlooked it, as i was looking for a complex lengthy formula. Great.

  18. #18
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Thanks all of you for your help, it was solved.

  19. #19
    Forum Contributor
    Join Date
    02-27-2009
    Location
    Chennai, India
    MS-Off Ver
    Excel 2013
    Posts
    327

    Re: Multiple If conditions, AND formula help needed

    Quote Originally Posted by JohnTopley View Post
    What is not working ????

    B1=20000 B5=14000, D5="NEW" , F4=0: D5=OLD"", F5=6000 (B1> B5)

    b1=12000, b5=14000, D5="NEW", f4=2000, d5="OLD", F4=0 (B1 < B5)
    Thank you. It solved, sorry.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Non-array Formula needed if conditions met
    By bjnockle in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-12-2020, 06:35 AM
  2. [SOLVED] Lookup Logic - Statement needed to evaluate multiple conditions
    By bdav1216 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-04-2019, 01:56 PM
  3. [SOLVED] Multiple If conditions help needed
    By jilaba in forum Excel General
    Replies: 3
    Last Post: 04-04-2019, 02:50 AM
  4. Sales Bonus Formula Based on Multiple Conditions Needed
    By NonStopLeo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-12-2018, 10:05 PM
  5. If formula for multiple conditions needed pls
    By sweetfriend9 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2016, 04:08 AM
  6. Urgent Help Needed! - Deleting rows by multiple conditions
    By shivboy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-01-2014, 04:54 AM
  7. Replies: 12
    Last Post: 05-15-2009, 08:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1