+ Reply to Thread
Results 1 to 7 of 7

Find biggest number in a string

Hybrid View

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Find biggest number in a string

    So basically, in a datasheet of orders I have a column that lists properties of each order, a cell that usually contains this value: "/", meaning no specific properties.

    However, if the order consists of let's say 8 elements, in that column I'll have cells with the entries "L1/8", "L2/8", "L3/8", ... etcetera until the entry "L8/8", meaning item 8 out of 8 items. Sometimes, that column will also list other properties, such as "cardboard" or "plastic" for the packaging or "trad" for traditional shipment, but as far as I know it won't list anything with numbers in it. So, although usually the cells in that column are just "/", they might be "L3/12, trad, plastic". In no specific order.

    Now, I want to have a formula that returns to me, how much elements does the order with most elements count?

    So basically, out of the following strings, it should return 7 for example.

    /
    /
    L1/5
    L2/5
    L3/5
    L4/5
    L5/5
    plastic, L1/3
    L2/3
    L3/3, trad
    cardboard
    /
    L2/7
    L3/7
    L5/7, trad
    L6/7

    Does anyone have any ideas?

    Cheers,

    HosteDenis

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find biggest number in a string

    will you please attach a sample file with expected result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find biggest number in a string

    If you have your data in Column a try below array formula and change the range if needed

    =MAX(IFERROR(MID(A1:A22,SEARCH("/*,",A1:A22&",")+1,SEARCH(",",A1:A22&",",SEARCH("/*,",A1:A22&","))-SEARCH("/*,",A1:A22&",")-1)+0,0))

    since the above is an array formula pls confirm the same with Shift+Ctrl+Enter

  4. #4
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Re: Find biggest number in a string

    Quote Originally Posted by nflsales View Post
    will you please attach a sample file with expected result
    I have, in this post now.

    problem.xlsx

    Quote Originally Posted by nflsales View Post
    If you have your data in Column a try below array formula and change the range if needed

    =MAX(IFERROR(MID(A1:A22,SEARCH("/*,",A1:A22&",")+1,SEARCH(",",A1:A22&",",SEARCH("/*,",A1:A22&","))-SEARCH("/*,",A1:A22&",")-1)+0,0))

    since the above is an array formula pls confirm the same with Shift+Ctrl+Enter
    Tried it, it returns zero (if I did everything right, so I don't think it works unless I entered it wrongly).

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find biggest number in a string

    See the attached file
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,489

    Re: Find biggest number in a string

    Did you enter with Shift+Ctrl+Enter? It worked for me using the data you supplied.

  7. #7
    Registered User
    Join Date
    04-26-2014
    Location
    Leuven, België
    MS-Off Ver
    Excel for Mac 2011
    Posts
    44

    Re: Find biggest number in a string

    It works, thanks a lot.

    Yeah sorry, apparently I didn't treat the formula as an array formula (although I've worked with array formula's before!).

    My bad, it works now! Thanks

+ 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. How to find the biggest numbers?
    By Vaggan in forum Excel General
    Replies: 2
    Last Post: 04-22-2014, 04:58 AM
  2. VBA To find nearest biggest number and lowest number
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2014, 05:49 AM
  3. [SOLVED] To find nearest biggest number
    By gan_xl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-10-2013, 07:43 AM
  4. To find nearest biggest number
    By gan_xl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2013, 06:49 AM
  5. Help Me to find biggest value
    By deepanc in forum Excel General
    Replies: 4
    Last Post: 01-22-2013, 12:15 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