+ Reply to Thread
Results 1 to 5 of 5

Using IF and OR within formula

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Using IF and OR within formula

    Alright, the formula I currently have is this:
    =IF(H31>0,"ABOVE: "&H31&"'")

    What I need to know, is how to use the IF and/or OR function to represent the opposite. What I mean is, if H31 is >0, I want the cell to show ABOVE: 44' (or whatever the value of H31 is). If H31<0, I want the cell to show BELOW: 44' (or whatever the value of H31 is).

    To take it a step further, in that same formula, if H31=0, I want the cell to show "A/B: ON LINE".

    I've always thought I had a great understanding of Excel, but I can't seem to figure this one out.

    Thanks for all your help!

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

    Re: Using IF and OR within formula

    Hi and welcome to the forum

    Your IF() function is only partly complete, you left off the 3rd part...
    =IF(this-is-true,do-this,-else-do-that) You left off the else-do-that part, and this is where you would put the extra part you want

    =IF(H31>0,"ABOVE: "&H31&"'","BELOW: "&H31&"'")
    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

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Using IF and OR within formula

    Ford,

    Thanks buddy! That makes sense lol. Now that I have that resolved, is there a way to take the (-) out of the cell that contains the formluat? What I mean is, if H31 = -23, A15(where the formula is located) reflects "BELOW: -23'". I don't want the "-" to be in A15. I want it to reflect just "BELOW: 23'".

    Thanks again Bud!

  4. #4
    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
    53,049

    Re: Using IF and OR within formula

    Maybe this...
    =IF(H31>0,"ABOVE: "&H31&"'","BELOW: "&ABS(H31)&"'")

  5. #5
    Registered User
    Join Date
    01-09-2014
    Location
    Texas
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Using IF and OR within formula

    Quote Originally Posted by FDibbins View Post
    Maybe this...
    =IF(H31>0,"ABOVE: "&H31&"'","BELOW: "&ABS(H31)&"'")
    Ford,

    You are a life saver!!! That worked exactly the way I need it to! Now is there a way to add the second part within the same formula? Because with my sheet, if the value of H31 is "0", I need A15 to reflect "A/B: On Line".

    I'm really sorry to ask so much, especially since I'm new and haven't gotten the chance to contribute to this awesome forum!
    Last edited by DrillinHole; 01-09-2014 at 11:23 PM.

+ 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. 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

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