+ Reply to Thread
Results 1 to 3 of 3

Help with macro that extracts the first number in a cell that contains two numbers.

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    US
    MS-Off Ver
    2013
    Posts
    1

    Help with macro that extracts the first number in a cell that contains two numbers.

    Hello,

    I would like to extract a single number from cells that contain two different numbers seperated by brackets. For example, the value in the cell would be 17.3(20.3). I would like to extract the first number, 17.3, and remove the bracket and second number, 20.3.

    I would like a macro that would extract all the first number in the whole column.

    If anybody could help me out, I would appreciate it. Thanks!

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help with macro that extracts the first number in a cell that contains two numbers.

    do you need a macro?
    a combination left,find formula could do it
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: Help with macro that extracts the first number in a cell that contains two numbers.

    Hi jl4ec,

    Welcome to the forum!!

    The following formulas are based on the numbers i.e. 17.3(20.3) being in cell A9 (change to suit):

    =ABS(LEFT(A9,SEARCH("(",A9)-1))
    =ABS(MID(A9,SEARCH("(",A9),255))

    The first formula will return 17.3 and the second 20.3

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

+ 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. Code that extracts cell contents from specific cells
    By TreeLife in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-24-2016, 08:43 AM
  2. simple code that extracts several items from middle of cell
    By l_eonandr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2016, 05:02 PM
  3. Replies: 8
    Last Post: 11-18-2013, 04:24 PM
  4. [SOLVED] VBA Macro - One Excel sheet which extracts information from multiple sheets.
    By Defratos in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-13-2013, 05:36 AM
  5. Replies: 1
    Last Post: 04-28-2011, 08:16 PM
  6. a macro that extracts sheets into a new file
    By hygum in forum Excel General
    Replies: 0
    Last Post: 04-19-2006, 03:30 AM
  7. [SOLVED] I need to create a macro that extracts daily files data to a mont.
    By Juan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-27-2006, 04:25 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