+ Reply to Thread
Results 1 to 6 of 6

What formula should I use to change a cell value with - and + signs

  1. #1
    Registered User
    Join Date
    04-22-2020
    Location
    Amsterdam
    MS-Off Ver
    365
    Posts
    86

    Question What formula should I use to change a cell value with - and + signs

    Hello all,

    I would like to change my cell value, which contains a minus (-) or a plus (+) in it, to a cell with Inflow (for the + signs) and an outflow (for the minus signs). So the Inflow cell should check if the value in column A is plus or minus and insert it into the Inflow or Outflow without the symbols, so I can calculate with the currencies. I have attached my spreadsheet for clarity.

    Thanks!

    Replace minus and plus sign.xlsx
    Last edited by luukos97; 12-18-2022 at 07:45 AM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,872

    Re: What formula should I use to change a cell value with - and + signs

    When I open your file, the values in column A are left aligned (and include commas as the decimal separator) indicating that they are text strings and not numbers. For me, whose system is set to use dot as decimal separator, I first need to replace the comma with a period, but you may not need to do that if your system settings are set to use comma as decimal separator.

    Assuming you don't need to do anything special with the text in order for Excel to recognize the text as a number, something like this should work:

    1) VALUE() function to convert number stored as text to number
    2) ABS(VALUE(A2)) can return the absolute value of the text in A2.
    3) NA() or whatever you want when the number isn't copied
    4) an IF() function to choose between (2) and (3) =IF(VALUE(A2)>0,ABS(VALUE(A2)),NA()) in column B. Similar in column C, but with less than instead of greater than or with the value_if_true and value_if_false arguments switched.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: What formula should I use to change a cell value with - and + signs

    Hi Luukos,

    In B2 put t his formula and pull it down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    in C2 put.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and pull it down.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: What formula should I use to change a cell value with - and + signs

    Users with decimal point is komma, like most dutch people, don't need substitute the decimal komma and don't need exclude the first character in the VALUE function:

    Users with decimal point is komma, please try in B2 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in C2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: What formula should I use to change a cell value with - and + signs

    I was worried that all his cells might not be text and should have tested for that before doing my/our formula(s).

    Perhaps a If(IsNumber()) or If(IsText()) should be before the formulas we have above. I was also worried what happens if neither a "+" or "-" was the first character of (hopefully) string. Should we toss in a message telling about the concern?

    I put in the Substitute to make the formula work in my language. I did know that commas and periods are language dependent, but I'm always ready to learn new things about Excel. It seems there is lots to still learn.

    Thanks.

  6. #6
    Registered User
    Join Date
    04-22-2020
    Location
    Amsterdam
    MS-Off Ver
    365
    Posts
    86

    Re: What formula should I use to change a cell value with - and + signs

    Thanks, it works!

+ 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. [SOLVED] sum values within a cell, data has plus signs
    By unreal_event_horizon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-15-2016, 07:41 AM
  2. [SOLVED] Fill up to max. 25 signs --> formula needed
    By liam3456 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-09-2015, 10:53 AM
  3. Conditional Formatting to Identify Change in Signs
    By FPAintern in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-26-2014, 09:34 AM
  4. Unknown toolbar with plus signs below formula bar
    By Rukovodilac in forum Excel General
    Replies: 3
    Last Post: 06-01-2011, 05:53 PM
  5. Code which deletes all signs behind a number of signs
    By Mula in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-30-2009, 05:53 AM
  6. Formula Signs & Rules
    By lsmft in forum Excel General
    Replies: 2
    Last Post: 01-23-2008, 02:38 PM
  7. Money signs appear in my Cell and I don't want them there
    By kate in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-10-2006, 03:30 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