+ Reply to Thread
Results 1 to 11 of 11

formula to change a Negative No to a Positive

Hybrid View

  1. #1
    Registered User
    Join Date
    12-23-2006
    Posts
    10

    Question formula to change a Negative No to a Positive

    This may be more of a math question rather than an Excel one.

    If I have a spreadsheet with a cell that produces different negative number each time it is used, is there a way i can add a formula to make it a positive number.

    So if Cell A1 showed -£244.22, I want to add an equation that changes if to £244.22

    Cell A1 changes so it would need to do the same for any negative number within that cell.

    Kudos to u all

  2. #2
    Forum Contributor
    Join Date
    07-05-2006
    Location
    Canada
    MS-Off Ver
    2003, 2007
    Posts
    581
    Generally, you'd use the function ABS()

    If A1 is itself a formula, you simply have to put the ABS() around the value, ie.
    A1: =ABS(A5*A6) [as an example]

    If A1 is an entry cell, you have four choices as I see it:
    1) Put this formula in B1: =ABS(A1) and then use B1 in your calculations.
    2) Put ABS(A1) in every formula where you use A1.
    3) Put Data -> Validation on the cell, and restrict input to positive values.
    4) Learn how to use VBA/Macros with Worksheet Events, so that if a negative value is entered, you automatically change it to a positive one. (Probably the most difficult of these suggestions.)

    Scott

  3. #3
    Registered User
    Join Date
    12-23-2006
    Posts
    10

    Cheers

    Thank you for the quick reply, I shall try out your suggestions.


  4. #4
    Registered User
    Join Date
    12-23-2006
    Posts
    10
    by the way

    Is there a function that will do the opposite (change a positive number to a negative)

    THanks

  5. #5
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    = - ABS(whatever)

  6. #6
    Forum Contributor
    Join Date
    10-14-2004
    Location
    San Diego, CA
    Posts
    213
    Try this:

    =IF(A1<0,ABS(A1),-ABS(A1))


    Matt

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Quote Originally Posted by Flintstone
    Try this:

    =IF(A1<0,ABS(A1),-ABS(A1))

    Matt
    I think this a little more than you'd need - you can do the same with

    =-A1

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,


    Try

    type -1 in an unused cell somewhere and copy it
    then select all the numbers you need to convert and then choose
    edit / paste special - MULTIPLY

    Or

    The simplest method would be to insert a column, and for each entry
    write a formula: =0-A1 (where A1 is the positive number- replace A1
    with your actual cell reference). Then copy the inserted column,
    highlight your original column, and Paste As values. Then delete the
    column you inserted.

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    or with some VBA

    Link shows you how to add code

    http://www.mcgimpsey.com/excel/modules.html

    Sub Change_to_Minus()
    Dim rcel As Range
    Dim Rng As Range
    Set Rng = Range(ActiveCell, Cells(Rows.Count, _
              ActiveCell.Column).End(xlUp))
        For Each rcel In Rng
        If rcel.Value <> "" And rcel.Value >= 0 Then
        rcel.Value = rcel.Value * -1
    End If
    Next rcel
    End Sub
    VBA Noob

+ 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