+ Reply to Thread
Results 1 to 8 of 8

Stumped on an IF Formula

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Stumped on an IF Formula

    Hello everyone, well I've officially broken down and need to ask for help!

    Here is the formula I'm trying to acheive in plain English...

    If IW5="N", display -4 unless JD19="Y", then display -2 instead. If IW5="Y", display 0. If both IW5 and JD19 equal "Y", then display 0.

    Let me know if I need to clarify any further, any help is much appreciated!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Stumped on an IF Formula

    Hi,

    What about
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Although you've not covered the IW5=Y and JD19=N condition
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    09-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Stumped on an IF Formula

    That worked perfectly! Thank you so much!

  4. #4
    Registered User
    Join Date
    09-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Stumped on an IF Formula

    Ok, I've modified my spreadsheet a bit, and now I'm trying to acheive the same thing only this time I'm dealing with ranges. Here's what I'm going for now in plain english...

    If G3:I23 contains "ATH", display 0. If G3:I23 contains "WS", display -2. If "ATH" and "WS" both show up in G3:I23, then display 0. If neither "ATH" nor "WS" show up in G3:I23, then display -4.

    Sorry if this is a confusing mess, let me know if I need to clarify anything. Thanks!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Stumped on an IF Formula

    a bit messy, and no doubt Richard will come up with something better, but try this...
    =IF(COUNTIF($G$3:$G$23,"ATH")=0,0,IF(COUNTIF($G$3:$G$23,"WS")=0,-2,IF(COUNTIF($G$3:$G$23,"ATH")+COUNTIF($G$3:$G$23,"WS")=0,-4,0)))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Stumped on an IF Formula

    Try:
    =IF(COUNTIF(G3:I23,"ATH"),0,IF(COUNTIF(G3:I23,"WS"),-2,-4))

  7. #7
    Registered User
    Join Date
    09-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Stumped on an IF Formula

    Wow, both of those worked great! Thanks again, you all are awesome!

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Stumped on an IF Formula

    You're welcome. Glad to help.

    If you are satisfied with the solution(s) provided, please remember to mark your thread as Solved.
    New quick method:
    Select Thread Tools (above first post on page) -> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word "Title" you will see a dropdown with the words "No prefix".
    Change to "Solved"
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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