+ Reply to Thread
Results 1 to 8 of 8

Recognize Negative Number

  1. #1
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Recognize Negative Number

    Hello,

    How can I make excel to recongnize this: 123456- as a negative number????

    Thanks for the help
    Last edited by Bob@Sun; 01-28-2010 at 06:38 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Recongnize Negative Number

    Hi Bob,

    You can use a formula, such as:

    =(RIGHT(A1,1)&LEFT(A1,LEN(A1)-1))+0

    This creates a text string of, for example, -123456, and then adds 0 to it to convert it to a number within the cell.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Recongnize Negative Number

    How about this:

    =IF(ISNA(FIND("-",A1)),A1,0-SUBSTITUTE(A1,"-",""))
    Last edited by zbor; 01-28-2010 at 06:28 PM.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Recongnize Negative Number

    ZBor, what is the "&D2" at the end of your formula for?

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,607

    Re: Recognize Negative Number

    Nothing Sorry, moved with arrows...

  6. #6
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Recognize Negative Number

    Well Paul's formula works fine, but mess up the number if there is no "-" after the number. Can you please fix that?

    I can not understand zbor's function: =IF(ISNA(FIND("-",A1)),A1,0-SUBSTITUTE(A1,"-",""&D2))

    Why is that D2 in it. what do you have in this cell?

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Recognize Negative Number

    Just remove the "&D2" bit. Was an accidental key-press. To use mine, you would need to change it to:

    =IF(RIGHT(A1,1)="-",(RIGHT(A1,1)&LEFT(A1,LEN(A1)-1))+0,A1)

  8. #8
    Forum Contributor Bob@Sun's Avatar
    Join Date
    09-03-2009
    Location
    Montuak, Usa
    MS-Off Ver
    Excel 2007
    Posts
    438

    Re: Recognize Negative Number

    Thanks Paul!

    Excelent Work!

+ 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