+ Reply to Thread
Results 1 to 5 of 5

Converting values >9 into 0

  1. #1
    Registered User
    Join Date
    04-09-2008
    Posts
    16

    Converting values >9 into 0

    Hi guys,

    I want to convert any value greater than 9 in column "k" of a spreadsheet to "0". Can anyone share their wisdom?

    Forgive my ignorance.... but is there a quick and easy way to ignore the negative sign, e.g. if a value (in a separate cell) is -6, I need it to display as 6?

    Thanks in advance!!!

    Chris

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Quote Originally Posted by chriss
    Hi guys,

    I want to convert any value greater than 9 in column "k" of a spreadsheet to "0". Can anyone share their wisdom?

    Forgive my ignorance.... but is there a quick and easy way to ignore the negative sign, e.g. if a value (in a separate cell) is -6, I need it to display as 6?

    Thanks in advance!!!

    Chris
    Try this code
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor stevebriz's Avatar
    Join Date
    09-07-2006
    Location
    Santiago Chile
    Posts
    389
    Part 1
    If the you want to put the "0"in the a seprate cell then you can use the formula

    Please Login or Register  to view this content.

    If this not what you want let us know...


    Part 2
    Use the formula in the separate cell ( this takes the absolute value of the value in A1
    Please Login or Register  to view this content.
    HTH
    Steve
    VBA - The Power Behind the Grid

    Posting a sample of your workbook makes it easier to look at the Issue.

  4. #4
    Forum Contributor
    Join Date
    11-13-2007
    Location
    Petersfield, Hampshire, UK
    MS-Off Ver
    MS Office for Mac ver 16
    Posts
    135
    Hi Chriss,

    Without using VB you could use the formula IF(K1>9,0,K1) in a new column to convert any number above 9 to 0

    I'm not sure whether your number that you want to convert might also be negative.

    If it is a separate number then the formula =IF(K1<0,K1*-1,K1) in a new column will convert any negative number to a positive.

    If the number might be negative and cannot be above 9 then formula IF(K1<0,K1*-1,IF(K1>9,0,K1)) works but not if the negative number is less than -9.

    Hope that helps
    Geoff Culbertson
    Petersfield, UK

  5. #5
    Registered User
    Join Date
    04-09-2008
    Posts
    16
    Thanks for the replies guys.

    Glio, I tried your formulas first and they worked perfectly.

    Thanks for all the help!!!

    Chris

+ 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