+ Reply to Thread
Results 1 to 17 of 17

Extracting 4 figure number out of contents of excel cell

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Extracting 4 figure number out of contents of excel cell

    Hi Everyone,
    I have excel column where each cell has some 4 digits number as shown in the attached sample file. I want to extract that 4 digits number as shown in the sheet named "after". If you can provide the solution in the form of formula such we could alter it to extract 3 digits number then it should be possible. I hope you would understand my question. Please see the attachment for details.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Extracting 4 figure number out of contents of excel cell

    Try this macro
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Can we do it using formula? I used the macro on sheet containing 200 entries but it only worked on first 3 rows only.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting 4 figure number out of contents of excel cell

    Hi,

    =0+MID(A1,MATCH(6,MMULT(ABS(ISNUMBER(0+MID(MID(" "&A1&" ",ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)-2)),6),{1,2,3,4,5,6},1))-{1,0,0,0,0,1}),{1;1;1;1;1;1}),0),4)

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Extracting 4 figure number out of contents of excel cell

    your data must be with non empty cells in column (A)
    Else we must to change the code
    like this
    Please Login or Register  to view this content.
    Last edited by salim ali; 08-21-2019 at 04:25 PM.

  6. #6
    Forum Contributor
    Join Date
    04-15-2015
    Location
    beirut
    MS-Off Ver
    2010
    Posts
    107

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by anonymous321 View Post
    Can we do it using formula? I used the macro on sheet containing 200 entries but it only worked on first 3 rows only.
    your data must be with non empty cells in column (A)
    Else we must to change the code
    like this
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by salim ali; 08-21-2019 at 04:36 PM.

  7. #7
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    The error is "The formula uses more levels of nesting than you can use in the current file format."

  8. #8
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by XOR LX View Post
    Hi,

    =0+MID(A1,MATCH(6,MMULT(ABS(ISNUMBER(0+MID(MID(" "&A1&" ",ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)-2)),6),{1,2,3,4,5,6},1))-{1,0,0,0,0,1}),{1;1;1;1;1;1}),0),4)

    Regards
    The error is "The formula uses more levels of nesting than you can use in the current file format."

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by anonymous321 View Post
    The error is "The formula uses more levels of nesting than you can use in the current file format."
    Your profile says 2007, not 2003. Can you clarify?

    Regards

  10. #10
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by XOR LX View Post
    Your profile says 2007, not 2003. Can you clarify?

    Regards
    It is excel 2016

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,368

    Re: Extracting 4 figure number out of contents of excel cell

    Then you must have saved the file as .xls in compatibility mode. Try saving the file as .xlsx and try the formula again.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  12. #12
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by anonymous321 View Post
    The error is "The formula uses more levels of nesting than you can use in the current file format."
    Can we change the formula such that it finds 3 digits number instead of 4 digits?

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by anonymous321 View Post
    Can we change the formula such that it finds 3 digits number instead of 4 digits?
    Hang on - what about the previous conversation re Excel version? Does this need to be compatible with Excel 2003 or not?

    Regards

  14. #14
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by XOR LX View Post
    Hang on - what about the previous conversation re Excel version? Does this need to be compatible with Excel 2003 or not?

    Regards
    AliGW's suggested solution worked with your formula.

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting 4 figure number out of contents of excel cell

    So you still need help with the change to work for 3 digits instead of 4?

    Regards

  16. #16
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting 4 figure number out of contents of excel cell

    Quote Originally Posted by XOR LX View Post
    So you still need help with the change to work for 3 digits instead of 4?

    Regards
    Yes that is needed.

  17. #17
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extracting 4 figure number out of contents of excel cell

    Ok.

    =0+MID(A1,MATCH(5,MMULT(ABS(ISNUMBER(0+MID(MID(" "&A1&" ",ROW(INDEX(A:A,1):INDEX(A:A,LEN(A1)-2)),5),{1,2,3,4,5},1))-{1,0,0,0,1}),{1;1;1;1;1}),0),3)

    Regards

+ 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] Vlookup last column figure if the figure is a number
    By SiewLee_81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-17-2019, 04:23 AM
  2. Trouble extracting partial text from cell contents
    By DeanR in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-10-2015, 12:40 PM
  3. [SOLVED] Exact extracting of contents into another cell
    By navinjayanand in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-31-2014, 08:45 AM
  4. Extracting a figure from one cell base upon information from 2 other cells
    By jono7gold in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-20-2014, 09:29 PM
  5. How to Reverse Contents in an Excel cell (Text or a Number)
    By CeeGee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-06-2014, 07:40 AM
  6. auto item number when a cell has figure
    By mercu in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-12-2013, 10:58 AM
  7. [SOLVED] extracting number from cell contains both text and number alternatively
    By green369 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-03-2013, 10:17 AM

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