+ Reply to Thread
Results 1 to 4 of 4

Multiplying by -1

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Multiplying by -1

    Hi all,

    I have several cells containing numbers, and also either DB or CR depending on whether the amount is positive or negative.

    Eg. 100,000 DB would be -100,000
    100,000 CR would be +100,000

    I need to work out a way to convert the cells from the DB/CR format to a number format so that they can be used in formulas.

    Does anyone have an idea as to how i might go about doing this?

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Multiplying by -1

    Try this:

    =IF(RIGHT(A1,2)="DB",-1,1)*TRIM(LEFT(A1,LEN(A1)-2))

    with your entry in A1.

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: Multiplying by -1

    try it
    =LEFT(A1,FIND(" ",A1))*IF(RIGHT(A1,2)="DB",-1,1)

  4. #4
    Registered User
    Join Date
    01-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Multiplying by -1

    Thanks Pete, that worked perfectly

+ 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