+ Reply to Thread
Results 1 to 13 of 13

Find digits with custom format and make them negative

  1. #1
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Find digits with custom format and make them negative

    Hii freinds after long time i.e.(after 2 days ),

    I want to find digit with custom format i.e ended with Cr and want to make them negative.
    Can it be done with single click....
    Attached Files Attached Files
    Don`t care, take care...

    Regards,
    Mangesh

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Find digits with custom format and make them negative

    I guess you will have to use a Formula to Add relevant sing (+,-) based on Dr or Cr. And then use Format Cells to add Dr. Cr. at the end..

    To the best of my knowledge, I do not know a way to do it directly..

    Note: I thought Dr. & Cr. are Text Strings and hence suggested this.. Since Dr & Cr as used as Number Formats, this wont work..
    Last edited by NeedForExcel; 07-24-2015 at 01:59 AM. Reason: Important Note
    Cheers!
    Deep Dave

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Find digits with custom format and make them negative

    =if(right(a12,2)="Cr",-LOOKUP(99^99,--("0"&MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),ROW($1:$10000)))),a12)
    Please Login or Register  to view this content.
    Did not read the above part, so the formula won't work.
    Last edited by oeldere; 07-24-2015 at 01:48 AM. Reason: a12,2)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Find digits with custom format and make them negative

    Or maybe something like this?

    Please Login or Register  to view this content.
    Last edited by NeedForExcel; 07-24-2015 at 02:04 AM.

  5. #5
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Find digits with custom format and make them negative

    Some error "You have entered too many arguments for this function"

  6. #6
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Find digits with custom format and make them negative

    Not unless you use VBA or use the GET.CELL property within Excel.

    Using GET.CELL, you need to create a named range (for example CellText) and define the name as =GET.CELL(53,INDIRECT("RC1",FALSE))
    Then, on the same row as those numbers (e.g. C12), type in the formula =IF(RIGHT(CellText,2)="Cr",-1,1) * A12
    See attached example below (you'll need to enable macros)

    Tell us if you'd prefer the VBA option (EDIT: or see NeedForExcel's comment)
    Attached Files Attached Files
    Last edited by quekbc; 07-24-2015 at 01:49 AM. Reason: Linked VBA option to NeedForExcel's comment

  7. #7
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Find digits with custom format and make them negative

    Thats great Needforexcel.... awesome..
    Please explain the coding...

  8. #8
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Find digits with custom format and make them negative

    Thanks quekbc...
    I am always hungry for VBA ....

  9. #9
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Find digits with custom format and make them negative

    Quote Originally Posted by mangesh.mehendale View Post
    Thats great Needforexcel.... awesome..
    Please explain the coding...
    We basically need VBA as Dr & Cr Values are Set as Number Formats and not Strings.

    So the Code basically goes through each Cell and Checks the number format to see if it is a Dr entry or a Cr Entry..

    If it is Cr, and already does not have a -ve sign, it multiplies the Cell Value by -1 to make it negative..

    Hope it helps..

  10. #10
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Find digits with custom format and make them negative

    Thank you for the rep & feedback..

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Find digits with custom format and make them negative

    Thank you everybody...
    Thank oeldere .. but still not working not showing negative value...

    Last question before I mark it as solve, let me know about GET.CELL property..

  12. #12
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: Find digits with custom format and make them negative

    GET.CELL function is an old Excel 4 Macro that was removed from Excel, but can still be used within Excel using a workaround.

    For more information see http://www.mrexcel.com/forum/excel-q...arguments.html

  13. #13
    Valued Forum Contributor mangesh.mehendale's Avatar
    Join Date
    06-04-2015
    Location
    India
    MS-Off Ver
    2007
    Posts
    510

    Re: Find digits with custom format and make them negative

    Thank... interesting quekbc
    ...

+ 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. Replies: 3
    Last Post: 07-01-2015, 10:05 AM
  2. Replies: 2
    Last Post: 12-01-2014, 03:25 PM
  3. Custom Format - Negative Problem
    By pizzalover in forum Excel General
    Replies: 1
    Last Post: 10-27-2009, 11:44 PM
  4. make a custom Format?
    By Zyphon in forum Excel General
    Replies: 5
    Last Post: 09-20-2007, 08:44 AM
  5. make:Custom Number Format
    By robertjtucker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2006, 02:35 PM
  6. Custom Format- Negative Percentages
    By astrowaites in forum Excel General
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  7. [SOLVED] How do I format a column to automatically make it a negative numbe
    By Kathy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-25-2005, 12:06 AM

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