+ Reply to Thread
Results 1 to 22 of 22

IF formula to include multiple conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    IF formula to include multiple conditions

    Having problems a formula when cells have "0" value

    =IF(C6=0,"",C6+$C$3/E6)

    I need the formula to still calculate if C6 is 0 and if E6 is 0
    also if possible I would like to suppress the #div/0 error

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: IF formula to include multiple conditions

    =iferror(if(c6=0,if(e6=0,c6+$c$3/e6),""),"")
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: IF formula to include multiple conditions

    =if(c6=0,"",c6+iferror($c$3/e6,0))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by nflsales View Post
    =if(c6=0,"",c6+iferror($c$3/e6,0))
    The formula partially worked If e6 value is 0 it works, but if the c6 value is 0 the cell is left blank.
    I tried a few things , but no success, little confused why the c6 is causung problems.

    Much thanks in advance

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: IF formula to include multiple conditions

    Yes the issue is C6 since if C6 is 0 then "" or null/blank
    =if(c6=0,"",c6+iferror($c$3/e6,0))
    based on nflsales you can change the "" to 0

    =if(c6=0,0,c6+iferror($c$3/e6,0))
    When will it return blank?
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  6. #6
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by vlady View Post
    Yes the issue is C6 since if C6 is 0 then "" or null/blank
    based on nflsales you can change the "" to 0

    =if(c6=0,0,c6+iferror($c$3/e6,0))
    When will it return blank?
    This formula also partially worked If e6 value is 0 it works great, but if the c6 value is 0 and e6 has a value it results in 0.00

    not sure why that is...

  7. #7
    Registered User
    Join Date
    02-11-2015
    Location
    Santa Rosa, CA
    MS-Off Ver
    2019
    Posts
    46

    Re: IF formula to include multiple conditions

    I would start with the E6=0 issue. Try this: =IF(E6=0,"",IF(C6=0,"",C6+$C$3/E6))

    Good luck,
    Jim Robison

  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
    30,687

    Re: IF formula to include multiple conditions

    If we still calculate if C6=0

    =if(e6=0,"",c6+$c$3/E6)

  9. #9
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by JohnTopley View Post
    If we still calculate if C6=0

    =if(e6=0,"",c6+$c$3/E6)
    This formula resolved the issue when C6 value is 0, but when E6 value is 0 and c6 has a value it returns a
    error "#value!" It helped the C6 issue, but caused the e6 error.

  10. #10
    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
    30,687

    Re: IF formula to include multiple conditions

    Check what is in C3 - is it non-numeric? I have just checked the conditions above and it worked OK. If E6=0 and C6 has a value, it returns a blank.

    Post a sample sheet.

  11. #11
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by JohnTopley View Post
    Check what is in C3 - is it non-numeric? I have just checked the conditions above and it worked OK. If E6=0 and C6 has a value, it returns a blank.

    Post a sample sheet.
    For me if C6 is 0 it works, but if E6 is 0 I get #Value! error

    Also note that E6 value comes from another eqaution =IF(D6=0,"",60/D6)

    I atttached the excel file.

    Quote Sheet-test.xlsx

  12. #12
    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
    30,687

    Re: IF formula to include multiple conditions

    Change formula in E6 and copy down:

    =IF(D6=0,0,60/D6)

  13. #13
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by JohnTopley View Post
    Change formula in E6 and copy down:

    =IF(D6=0,0,60/D6)
    This didn't work, I changed the forumla in E6 and get a Blank result in F6 when either c6 or e6 value is "0"

  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
    30,687

    Re: IF formula to include multiple conditions

    Your conditions are:

    in E6: if(D6=0,0,60/D6)

    in F6: IF (E6=0,0,C6+$c$3/60)

    C6 and D6 are data only: C6 is only used in the formula in F6. If C6 is 0 but D6<> 0 then F6 will contain result.

    If D6=0 then E6=0 then F6=0

    So are the IF statements correct?

  15. #15
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by JohnTopley View Post
    Your conditions are:

    in E6: if(D6=0,0,60/D6)

    in F6: IF (E6=0,0,C6+$c$3/60)

    C6 and D6 are data only: C6 is only used in the formula in F6. If C6 is 0 but D6<> 0 then F6 will contain result.

    If D6=0 then E6=0 then F6=0

    So are the IF statements correct?
    C6 is direct data only and is only added to the result of E6

    D6 is direct data and used in the E6 Formula

    E6 is the result of the data in D6 and is always the result 60/D6

    so C6 can be 0 sometimes and D6 can be 0 which will drive E6 to be 0

    I can not get the forulama to give a result when one of either C6 or E6 is at 0

    Very confusing...

  16. #16
    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
    30,687

    Re: IF formula to include multiple conditions

    If E6 has no bearing on F6 why are we testing if it is 0 in F6 formula???

  17. #17
    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
    30,687

    Re: IF formula to include multiple conditions

    D6 is the problem: if 0 , all results 0. So is allowing D6=0 an error?

    Value in C6 has no impact on F6 i.e. will not result in an error.

    C6 is direct data only and is only added to the result of F6

  18. #18
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Cell F6 formula: =IF(C6=0,$C$3/E6,IF(E6=0,"",C6+IFERROR($C$3/E6,0)))

    This gives me the best result, but still have the #VALUE! error when both C6 & E6 are both Blank
    I would love to remove the error if possible?

    Current working formulas:

    Cell F6: =IF(C6=0,$C$3/E6,IF(E6=0,"",C6+IFERROR($C$3/E6,0)))

    Cell E6: =IF(D6=0,"",60/D6)



    C6: direct data only

    D6: direct data only

    quote-sheet-test3.xlsx

  19. #19
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: IF formula to include multiple conditions

    Hi, May be this

    Formula: copy to clipboard
    =IFERROR(IF(C6=0,$C$3/E6,IF(E6=0,"",C6+IFERROR($C$3/E6,0))),"")
    Click just below left if it helps, Boo?ath?

  20. #20
    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
    30,687

    Re: IF formula to include multiple conditions

    Look at sheet TEST in attached - hopefully what you require.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    06-04-2015
    Location
    Denver Colorado
    MS-Off Ver
    MS Office 2010
    Posts
    9

    Re: IF formula to include multiple conditions

    Quote Originally Posted by JohnTopley View Post
    Look at sheet TEST in attached - hopefully what you require.
    Thank you very much John! Perfect.
    I really appreciate everyone's time and efforts

  22. #22
    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
    30,687

    Re: IF formula to include multiple conditions

    Just glad we found a solution !!!!

+ 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. [SOLVED] IF formula to include multiple conditions
    By sunshine82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2015, 09:16 AM
  2. COUNTIF formula - how to include multiple columns
    By seaturtle89 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2014, 04:43 AM
  3. IF(OR Formula will not include certain conditions
    By Holly.Pittam in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-17-2014, 05:53 AM
  4. [SOLVED] Editing a Macro to include multiple rows and include text formatting for leading zeros
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-04-2014, 09:50 AM
  5. Replies: 1
    Last Post: 11-09-2011, 04:45 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