Results 1 to 4 of 4

Thread: enter 1 if cell is negative number, zero if positive
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2006
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default enter 1 if cell is negative number, zero if positive

    Hi,

    I have a number in Cell G1. This number will be either negative or positive. Im trying to write a formual in cell I1 that will display a 1 if G1 is negative and a 0 if G1 is positive. Thanks for the help!

    Rob

  2. #2
    Board Regular
    Join Date
    Apr 2018
    Location
    UK
    Posts
    224
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: enter 1 if cell is negative number, zero if positive

    how about:

    =IF(G1<0, 1, 0)

    although are you counting 0 as positive or negative?
    Last edited by Finalfight40; Sep 10th, 2019 at 12:05 PM.
    VBA is ten percent luck
    Twenty percent skill
    Fifteen percent concentrated power of will
    Five percent pleasure
    Fifty percent pain
    And a hundred percent reason to remember the name

  3. #3
    Board Regular Gerald Higgins's Avatar
    Join Date
    Mar 2007
    Location
    Edinburgh
    Posts
    9,084
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: enter 1 if cell is negative number, zero if positive

    Or slightly simpler . . .

    =--(G1<0)
    The following is my SIGNATURE. It's not part of any question or solution I'm posting. If it IS your solution, you've got a very weird problem !

    Sub Macro()
    ActiveCell = "IY" & Right(Application.Name, 5)
    With ActiveCell.Characters(Start:=2, Length:=1).Font
    .Name = "Webdings"
    .Color = 255
    End With
    End Sub

  4. #4
    Board Regular
    Join Date
    Oct 2006
    Posts
    104
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: enter 1 if cell is negative number, zero if positive

    Perfect, thanks

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •