+ Reply to Thread
Results 1 to 5 of 5

Need help with If formula

  1. #1
    Registered User
    Join Date
    10-09-2015
    Location
    Illinois, USA
    MS-Off Ver
    2013
    Posts
    8

    Need help with If formula

    I need a cell to return display a rating if another cell contains a value between different ranges. Ex: if cell A is 0-1 B is 5, 1-2 B is 4 etc. I used an if formula and it worked just fine, the only problem is that since i have it set up to display a 5 if the cell is between 0-0.5 it displays a 5 when there is nothing entered. It is registering the cell as a zero when it is empty. I want the cell to remain blank if nothing is entered in the other one. I tried Isblank, and just tacking on another if function but neither have worked. Here is the formula.

    =IF(N39>=5,"1",IF(N39>=4,"2",IF(N39>=2,"3",IF(N39>=1,"4",IF(N39>=0,"5",IF(ISBLANK(N39),""))))))

    I've also tried:

    =IF(N39>=5,"1",IF(N39>=4,"2",IF(N39>=2,"3",IF(N39>=1,"4",IF(N39>=0,"5",IF(N39,"",""))))))

    Thanks in advance.

    I'm pretty inexperienced if ya can't tell.

  2. #2
    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,127

    Re: Need help with If formula

    It would be easier if you set out excatly what your conditions are. Is this close?

    =IF(N39="","",IF(N39>5,0,5-INT(N39)))
    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

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,369

    Re: Need help with If formula

    Can you provide the worksheet so we can see what is going on?
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    11-25-2013
    Location
    Western Australia
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Need help with If formula

    You were on the right track. The reason ISBLANK wasn't working is that it was too late in the formula. By default, Excel will see blank and zero as the same thing so it was determining that N39>=0 was true and stopping the formula at that point.
    By moving ISBLANK to the beginning, the formula will stop at that point if it's blank and proceed to the last function only if it's actually zero.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-09-2015
    Location
    Illinois, USA
    MS-Off Ver
    2013
    Posts
    8

    Re: Need help with If formula

    Quote Originally Posted by Larena View Post
    You were on the right track. The reason ISBLANK wasn't working is that it was too late in the formula. By default, Excel will see blank and zero as the same thing so it was determining that N39>=0 was true and stopping the formula at that point.
    By moving ISBLANK to the beginning, the formula will stop at that point if it's blank and proceed to the last function only if it's actually zero.

    Please Login or Register  to view this content.
    It worked! Thank you so much.

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

Tags for this Thread

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