+ Reply to Thread
Results 1 to 8 of 8

Converting a # into negative if the texts is one or the other

  1. #1
    Registered User
    Join Date
    11-05-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    Question Converting a # into negative if the texts is one or the other

    Hi all,

    I am a beginner Excel user and need some help coming up with the right formula.


    data 100.10 data data Check
    data 54.45 data data Receipt
    data 23.12 data data Wire
    data 299.18 data data Receipt
    data 54.77 data data Receipt

    If E1 equals "Check" or "Wire" texts, I need B1 to convert to -100.10 (negative #).
    E2 does not equal the "Check" or "Wire" texts, so it stays as 110.00.

    What formula would you use? Thank you very much.
    Last edited by Auditors; 11-05-2015 at 11:42 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Converting a # into negative if the texts is one or the other

    Hi welcome to the forum

    Try this...
    =B1*if(or(E1="CHECK",E1="Wire"),-1,1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-05-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Converting a # into negative if the texts is one or the other

    Thank you for the prompt response.

    I forgot to mention, so I want cell B1 to stay positive or change to negative if E1 equals either of those texts.
    How do you enter that formula into B1? Not sure where to put 100.10 into that formula.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Converting a # into negative if the texts is one or the other

    Sorry, where is the value you need to be converted?

    Change the reference xxxxxxx to that....
    =xxxxxx*if(or(E1="CHECK",E1="Wire"),-1,1)

  5. #5
    Registered User
    Join Date
    11-05-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Converting a # into negative if the texts is one or the other

    Thank you for the formula.

    I understand now why cell B1 "100.10" would not convert to negative even though E1 matches the text.
    Need to display the result in a new column.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Converting a # into negative if the texts is one or the other

    Are the values in column B hard numbers or there formulas in B that return those values? If they are hard numbers you'll need a separate formula like Ford wrote, or you'll need a macro (Visual Basic for Applications a.ka. VBA).

    If they are formulas you could try something similar directly in column B ... something like this

    =<your formula>*if(or(E1="CHECK",E1="Wire"),-1,1)
    Dave

  7. #7
    Registered User
    Join Date
    11-05-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    4

    Re: Converting a # into negative if the texts is one or the other

    Thank you Dave and Ford. Column B were hard numbers; creating a new column and using Ford's formula worked.

    [SOLVED]
    Last edited by Auditors; 11-06-2015 at 12:14 AM.

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Converting a # into negative if the texts is one or the other

    Cross-posted at: http://www.mrexcel.com/forum/excel-q...one-other.html
    For cross-posting etiquette, please read FORUM RULE 8: http://www.excelforum.com/forum-rule...rum-rules.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ 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] Automatically converting any negative number to a positive
    By tommanley01 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-02-2014, 11:59 AM
  2. [SOLVED] Converting a negative value to a positive one
    By JDodger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-02-2014, 03:08 PM
  3. Converting A Negative Value Cell to Zero Automatically
    By striker_rage in forum Excel General
    Replies: 7
    Last Post: 07-25-2010, 11:24 AM
  4. Converting Negative Numbers Into Dates
    By artoni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2009, 09:17 PM
  5. Converting Negative Numbers to 0's
    By DangerMouse in forum Excel General
    Replies: 3
    Last Post: 01-12-2007, 06:19 AM
  6. converting text to negative numbers!
    By via135 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-05-2006, 02:29 AM
  7. Converting negative numbers
    By crparedes in forum Excel General
    Replies: 2
    Last Post: 01-10-2005, 04:46 PM

Tags for this Thread

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