+ Reply to Thread
Results 1 to 10 of 10

Extract largest or smallest value from a CELL

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    85

    Extract largest or smallest value from a CELL

    Hi all,

    I have data such as the following:

    54 x 0.5 = 2.5
    0.5*2.898=78
    Test:0.8*0.98=5.2
    ~0.85 (0.32*2.45)

    And need to extract the smallest number in one row so,

    0.5
    0.5
    0.8
    0.32

    And extract the largest number in another:

    54
    78
    5.2
    2.45

    This needs to be done with EXCEL FUNCTIONS instead of macros as it will be distributed across other PCs. I found a formula that can extract 1st,2nd,3rd etc numbers in a cell, by changing C1 to 1,2,3 etc:
    =LOOKUP(10^99,--MID("|"&A1,SMALL(IF(((--ISNUMBER(--("0"&MID(
    SUBSTITUTE(" "&A1," ","|"),ROW($1:$25),1)))=0)*ISNUMBER(--(MID(
    SUBSTITUTE(" "&A1," ","|"),ROW($2:$26),1)))),ROW($2:$26)),C1),ROW($1:$25)))

    Tried to modify it to check smaller or larger number with on luck, maybe could help someone?

    Any help would be greatly appreciated!

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Extract largest or smallest value from a CELL

    Just to be clear, the data is a string of text, such that your example would be in 4 rows and 1 column in the system, right?

    Let's assume that's in column A.
    If you already have something that can extract the numbers, and there's always three numbers in each row, then I'd use five more columns for each row like this:
    B = 1st number
    C = 2nd number
    D = 3rd number
    E = MIN(B1:D1) / outputs the smallest of the numbers in the row B1 to D1
    F = MAX(B1:D1) / outputs the largest of the numbers in the row B1 to D1

    That would be my general approach. If you want something more specific you would get more success posting an example spreadsheet for us to play with.

  3. #3
    Registered User
    Join Date
    09-30-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    85

    Re: Extract largest or smallest value from a CELL

    Apologies, yes the data is in 4 rows and 1 column.
    That would work, didn't think of that! However, it would be useful if it could be combined to a single formula/cell, is that possible?

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Extract largest or smallest value from a CELL

    Yeah, just nest the formulas:
    E = MIN( 1st_number_finder, 2nd_number_finder, 3rd_number_finder)
    Like that.

    ...I say that, but it is an extremely rare usage where the costs of a bigger spreadsheet are greater than the costs of something that takes people longer to understand. If it was me I would push back against nesting them into a big ol' monster, and break them out so the numbers are each in their own column. If you have a screw up it would make it easier to find & debug, and if you need to get the SUM or AVE it's a trivial addition....

    But it's your spreadsheet.

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

    Re: Extract largest or smallest value from a CELL

    Try the attached file
    Attached Files Attached Files

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

    Re: Extract largest or smallest value from a CELL

    @nflsales

    If there's a prize for longest ever formula, I'm sure you're a good contender now!
    Click * below if this answer helped

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

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

    Re: Extract largest or smallest value from a CELL

    Mr XOR LX, is there any wrong in the formula?

  8. #8
    Registered User
    Join Date
    09-30-2013
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    85

    Re: Extract largest or smallest value from a CELL

    Good advice Ben, it's good to know it can be done both ways.
    Thanks nflsales, that works as well! Have to aggree with XOR, longest formula I've ever seen haha

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Extract largest or smallest value from a CELL

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED",as per our Forum Rule #9. I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: Extract largest or smallest value from a CELL

    "Mr XOR LX, is there any wrong in the formula?"

    Absolutely not, no! And I apologise if I sounded flippant - I didn't mean to belittle your work, which obviously took you a considerable amount of time. (Though I confess that I am also slightly wary of this type of solution - kind of reminds me of the old story of the worker who was asked to sum cells A1:A1000 - after two days' work and getting as far as writing:

    =SUM(A1,A2,A3,A4,A5,A6,A7,A8,...

    all the way up to A999, a colleague came along...and pointed out...well, you can guess...)

    Regards
    Last edited by XOR LX; 10-09-2013 at 04:55 AM.

+ 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. Sort largest to smallest - VBA
    By Ricardo Mass in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-12-2013, 09:05 AM
  2. [SOLVED] Formula to extract top largest to smallest amount based on 3 criterias
    By aurisab in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-26-2013, 08:05 AM
  3. 3 largest qty and 3 smallest
    By geng in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2010, 12:20 AM
  4. Largest and smallest sequences
    By smileyc in forum Excel General
    Replies: 8
    Last Post: 01-13-2009, 10:46 AM
  5. Sorting Largest To Smallest
    By all4excel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-24-2007, 10:30 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