+ Reply to Thread
Results 1 to 9 of 9

Help with complex if statement formula

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Help with complex if statement formula

    Hi All,

    Good morning. I am trying to come up with an IF function formula or some other better formula to do the below in one column so i can copy down;

    If cell G2=K, then H2
    If cell G2=S, then I2
    But if cell H2=0 or blank and I2=0 or blank, then J2*K2
    and if K2 is blank or =0 then J2*L2

    I have attached an example work sheet (Book1 - if func help).

    Thank you for your assistance.

    Pi
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,518

    Re: Help with complex if statement formula

    Try this:

    =IF(G2="K",H2,IF(G2="S",I2,IF(AND(H2=0,I2=0),J2*K2,IF(OR(K2="",K2=0),J2*L2))))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with complex if statement formula

    Thank you for your quick response AliGW

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

    Re: Help with complex if statement formula

    Try this. If incorrect, please state what the expected results are:

    =IF(AND(OR(H2=0,H2=""),OR(I2=0,I2="")),J2*K2,IF(OR(K2=0,K2=""),J2*L2,IF(G2="K",H2,IF(G2="S",I2))))
    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

  5. #5
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with complex if statement formula

    Thank you Glenn for your response.

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,411

    Re: Help with complex if statement formula

    Formula: copy to clipboard
    =if(and(g2="k",h2<>0,h2<>""),h2,if(and(g2="s",i2<>0,i2<>""),i2,if(and(or(h2=0,h2=""),or(i2=0,i2="")),j2*k2,if(or(k2=0,k2=""),j2*l2))))
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with complex if statement formula

    Thank you Czeslaw. The formula works except for the last part of the formula which says if K2 is blank or =0 then J2*L2.
    (that is if H2,I2 and K2 cells are 0 or blank but J2 and L2 have numbers, the formula results should be J2*L2.)
    Currently is will show 0

    Thank you for you time.

  8. #8
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,411

    Re: Help with complex if statement formula

    I think your remarks corrected.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with complex if statement formula

    Thank you very much for your time Czeslaw. You solved my question.

    Happy New!

+ 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. Complex IF Statement
    By Shadmani in forum Excel General
    Replies: 4
    Last Post: 12-29-2015, 10:39 AM
  2. complex if statement
    By young_eeyore in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-11-2015, 07:37 PM
  3. [SOLVED] building a complex formula with the IF statement and Mround function
    By echy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-04-2013, 12:24 PM
  4. [SOLVED] Complex IF AND OR statement
    By amack05 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-09-2012, 11:09 AM
  5. Complex Formula: IF statement?
    By sanportablo in forum Excel General
    Replies: 4
    Last Post: 01-28-2009, 08:05 PM
  6. Complex If Statement
    By robert_shindorf in forum Excel General
    Replies: 33
    Last Post: 12-12-2008, 09:08 PM
  7. Complex If statement formula
    By PeeGee in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2007, 05:03 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