+ Reply to Thread
Results 1 to 7 of 7

Separate Number Suffix?

  1. #1
    Registered User
    Join Date
    09-26-2014
    Location
    Raleigh, NC
    MS-Off Ver
    2007
    Posts
    2

    Separate Number Suffix?

    I have a data set that has various numbers with suffixes (1 PC, 1 PAC, 1 CV, etc.). The suffixes are generated by custom number formatting. The issue I have is that certain suffixes (such as PC and CV) indicate a x1 value, while others (such as PAC) indicate a different multiple, such as x3 in this case.

    I have tried =right, =text, and text to columns, but because it is a part of the format and not data in the cell the suffix isn't recognized. Also why conditional formatting won't work. is there any way to separate the suffix from the number or otherwise identify the items that need a different value?

    Simple example attached. Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Separate Number Suffix?

    you can use get.cell and old excel 4 macro function
    select B2
    then insert name /define
    create a name say "mycell"
    in refers to put =GET.CELL(53,Sheet1!$A2)
    so
    =mycell in b2 would then return the contents of a2 as text including the custom format
    then you can use in b2 formulas like
    =IF(RIGHT(mycell,3)="pac",A2*3,A2)
    note it needs to be saved as xlsm a macro enabled workbook
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Separate Number Suffix?

    Martin,

    Thank you for sharing the secrets of get.cell
    Additional info can be found at the URL in the the following post by Tony Valko.

    Lewis
    Last edited by LJMetzger; 09-26-2014 at 11:37 AM. Reason: Deferred to Tony Valko's Microsoft URL.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Separate Number Suffix?

    You can download the macro function help files here:

    http://support.microsoft.com/kb/128185

    EDIT: I see a link in the MrExcel post but it has a different URL. Both go to the same address.
    Last edited by Tony Valko; 09-26-2014 at 11:04 AM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    09-26-2014
    Location
    Raleigh, NC
    MS-Off Ver
    2007
    Posts
    2

    Re: Separate Number Suffix?

    Worked great, thanks!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Separate Number Suffix?

    Quote Originally Posted by Tony Valko View Post
    You can download the macro function help files here:

    http://support.microsoft.com/kb/128185
    Additional info...

    The download will install 3 files:

    Macrofun.cnt
    Macrofun.GID
    Macrofun.hlp

    If you're using Windows Vista or later then you'll have to also download and install an update that allows you to view help files in their new format.

    The update is available here:

    http://support.microsoft.com/kb/917607

    Once you have the files you need just double click the Macrofun.hlp file and you're good to go!

    Of note, if you use the macro functions in your Excel file you have to save the file as a macro enabled file in the *.xlsm format if you're using Excel 2007 or later.
    Last edited by Tony Valko; 09-26-2014 at 03:03 PM.

  7. #7
    Registered User
    Join Date
    10-12-2013
    Location
    Seattle, USA
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    36

    Re: Separate Number Suffix?

    GET.CELL is only one of several XL4 macro functions that are still very useful. Thanks Tony Valko for posting a link to XL4 macros functions documentation.

    However, because the documentation there is an .exe file, it's not accessible to Excel for Mac users. Those users (and all others) can access a complete XL4 macro function reference in the form of Word files: see my post at http://www.excelforum.com/showthread...t=#post4562316 to download...
    Last edited by ianpage; 01-20-2017 at 04:54 PM.

+ 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. Separating lastname + suffix to separate columns
    By 2by4 in forum Excel General
    Replies: 6
    Last Post: 03-20-2014, 01:12 AM
  2. [SOLVED] Number Suffix Question
    By VTJeep in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-15-2014, 10:28 AM
  3. [SOLVED] Changing a positive or negative value based on the input's suffix, then removing suffix
    By Theredwind in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-06-2014, 05:19 AM
  4. [SOLVED] adding unique number suffix
    By hmm321 in forum Excel General
    Replies: 2
    Last Post: 07-01-2012, 05:25 PM
  5. What does a number with suffix # mean?
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2005, 12:05 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