+ Reply to Thread
Results 1 to 13 of 13

Writing formula with IF, <, >, and =0

  1. #1
    Registered User
    Join Date
    11-22-2014
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    4

    Writing formula with IF, <, >, and =0

    Hey group, have a question for you. I currently have a working formula that reads =IF(H30>0,"RIGHT: "&H30&"'","LEFT: "&ABS(H30)&"'"). This does exactly what I want it to do except for if H30=0. If H30=0, I want it to say "On Line".

    Can someone please help. I've been working on this for a week!

    Thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Writing formula with IF, <, >, and =0

    Perhaps
    =IF(H3=0,"On line",IF(H30>0,"RIGHT: "&H30&"'","LEFT: "&ABS(H30)&"'"))

  3. #3
    Registered User
    Join Date
    11-22-2014
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    4

    Re: Writing formula with IF, <, >, and =0

    Quote Originally Posted by Pepe Le Mokko View Post
    Perhaps
    =IF(H3=0,"On line",IF(H30>0,"RIGHT: "&H30&"'","LEFT: "&ABS(H30)&"'"))
    No that doesn't work. It makes every value "On Line". Thanks for the trying however.

  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 2403
    Posts
    44,004

    Re: Writing formula with IF, <, >, and =0

    It does work. However, Pepe did make a small typo which maybe you didn't spot...

    =IF(H30=0,"On Line",IF(H30>0,"RIGHT: "&H30&"'","LEFT: "&ABS(H30)&"'"))

    =IF(H30 nor =IF(H3....
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Registered User
    Join Date
    11-22-2014
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    4

    Re: Writing formula with IF, <, >, and =0

    Quote Originally Posted by Glenn Kennedy View Post
    It does work. However, Pepe did make a small typo which maybe you didn't spot...

    =IF(H30=0,"On Line",IF(H30>0,"RIGHT: "&H30&"'","LEFT: "&ABS(H30)&"'"))

    =IF(H30 nor =IF(H3....
    ??????????

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Writing formula with IF, <, >, and =0

    =if(h30... Not =if(h3..
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Writing formula with IF, <, >, and =0

    Row\Col
    H
    I
    J
    30
    -1
    LEFT: 1' I30: =IF(H30 = 0, "On line", IF(H30>0,"RIGHT: " & H30 & "'", "LEFT: " & ABS(H30) & "'"))
    31
    0
    On line
    32
    1
    RIGHT: 1'
    33
    -1
    Left: 1' I33: =LOOKUP(SIGN(H33), {-1,0,1}, {"Left:","On Line","Right:"}) & TEXT(H33, " 0'; 0';")
    34
    0
    On Line
    35
    1
    Right: 1'
    Entia non sunt multiplicanda sine necessitate

  8. #8
    Registered User
    Join Date
    11-22-2014
    Location
    Houston, TX
    MS-Off Ver
    2010
    Posts
    4

    Re: Writing formula with IF, <, >, and =0

    Quote Originally Posted by martindwilson View Post
    =if(h30... Not =if(h3..
    Got it! Sorry, I work with numbers all day and they ran together on me. I didn't notice the typo and then the "nor" confused me even more. I was like "I didn't know there was a "nor" function." LOL Thank you both very much!!! Life Savers!!!

  9. #9
    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,929

    Re: Writing formula with IF, <, >, and =0

    Glen means that Pepe referenced H3 in the 1st IF statement, it should have been H30
    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

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

    Re: Writing formula with IF, <, >, and =0

    Ha Ha. I point out one typo and then make one of my own. That's what happens when you have 5 thumbs on each hand....
    Last edited by Glenn Kennedy; 11-22-2014 at 03:19 PM. Reason: I made another typo

  11. #11
    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,929

    Re: Writing formula with IF, <, >, and =0

    you mean, like that?
    LOL

  12. #12
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Writing formula with IF, <, >, and =0

    Quote Originally Posted by FDibbins View Post
    Glen means that Pepe referenced H3 in the 1st IF statement, it should have been H30
    That's what happens when you grow old ....

  13. #13
    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,929

    Re: Writing formula with IF, <, >, and =0

    tell me about it

+ 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. Writing VBA Formula
    By Edward Masoya in forum Excel General
    Replies: 1
    Last Post: 07-13-2011, 11:14 PM
  2. Writing formula using vba
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2011, 07:54 AM
  3. [SOLVED] Need help with writing formula please...
    By Soth in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-14-2006, 03:03 PM
  4. Replies: 2
    Last Post: 01-03-2006, 05:42 PM
  5. Help writing a formula
    By Adam in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 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