+ Reply to Thread
Results 1 to 27 of 27

finding MIN and MAX

  1. #1
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    finding MIN and MAX

    how do i find the MIN and MAX if it contains text variable

    for example my data, looks like these:

    BA 12549
    BA 12550
    BA 12551
    BA 12552
    BA 12553
    BA 12554

    i want only the numbers for my min and max

    MIN, in this case is 12549
    MAX, is 12554

    thank you

  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: finding MIN and MAX

    is the data in single column or in separate columns
    Samba

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

  3. #3
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    nflsales, in a single column

  4. #4
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: finding MIN and MAX

    If there are always 5 numbers (i.e. BA #####) then...

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

  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: finding MIN and MAX

    Will you pls attach a sample excel file

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding MIN and MAX

    Data Range
    A
    1
    BA 12549
    2
    BA 12550
    3
    BA 12551
    4
    BA 12552
    5
    BA 12553
    6
    BA 12554

    Data Range
    B
    C
    1
    12554
    12549

    Data Range
    B
    C
    1
    =MAX(IFERROR(VALUE(MID(A1:A6&" ",FIND(" ",A1:A6)+1,255)),0))
    =MIN(IFERROR(VALUE(MID(A1:A6&" ",FIND(" ",A1:A6)+1,255)),9^9))

    Both are array formula's so confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  7. #7
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    thank you, quekbc

  8. #8
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    sixthsense, 255 means?

  9. #9
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    suppose this data was a result of extracting a formula from another sheet, example

    BA 12549 (from sheet 1)
    BA 12550 (sheet 2)
    BA 12551 (sheet 3)
    BA 12552 (sheet 4)
    BA 12553 (sheet 5)
    BA 12554 (sheet 6)
    Debit (sheet 7)
    Credit (sheet 8)

    i want a MIN of 12549 and a MAX of 12554

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: finding MIN and MAX

    Are all these numbers meant to be on the same sheet (copied/extracted from other sheets)?

    BA 12549 (from sheet 1)
    BA 12550 (sheet 2)
    BA 12551 (sheet 3)
    BA 12552 (sheet 4)
    BA 12553 (sheet 5)
    BA 12554 (sheet 6)
    Debit (sheet 7)
    Credit (sheet 8)

    Are "Debit" and "Credit" always the last two entries in the list?
    Are "Debit" and "Credit" ALWAYS non-numerical?
    Last edited by Glenn Kennedy; 07-28-2015 at 02:55 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding MIN and MAX

    Quote Originally Posted by rcahayag1925 View Post
    suppose this data was a result of extracting a formula from another sheet,
    BA 12549 (from sheet 1)
    Revised formula for the above scenario

    =MAX(IFERROR(VALUE(TRIM(MID(TRIM(A1:A6)&" ",FIND(" ",TRIM(A1:A6))+1,IFERROR(FIND("(",TRIM(A1:A6))-FIND(" ",TRIM(A1:A6))-1,255)))),0))

    =MIN(IFERROR(VALUE(TRIM(MID(TRIM(A1:A6)&" ",FIND(" ",TRIM(A1:A6))+1,IFERROR(FIND("(",TRIM(A1:A6))-FIND(" ",TRIM(A1:A6))-1,255)))),9^9))

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding MIN and MAX

    Quote Originally Posted by rcahayag1925 View Post
    sixthsense, 255 means?
    Just a default end value

  13. #13
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    thank you sixthsense

  14. #14
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    Glenn Kennedy, these numbers are on same sheet now after being extracted from other sheets

    debit/credit are always non-numerical, these too, may appear anywhere (in the beginning, middle or last) in no order

    thank you

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: finding MIN and MAX

    Thanks, but I don't think it matters anymore: you seem to have an excellent solution already!!

  16. #16
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    sixthsense, the value yields to #NAME?

  17. #17
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding MIN and MAX

    Quote Originally Posted by rcahayag1925 View Post
    sixthsense, the value yields to #NAME?
    What is your excel version?

  18. #18
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    Quote Originally Posted by :) Sixthsense :) View Post
    What is your excel version?
    excel 2003

  19. #19
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: finding MIN and MAX

    Real quick question, in your table, you said

    BA 12549 (from sheet 1)
    BA 12550 (sheet 2)

    Are those texts (from sheet 1) actually showing in that cell?

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

    Re: finding MIN and MAX

    If you attached your excel file as said earlier, your query had solved in a long back.

  21. #21
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    Quote Originally Posted by quekbc View Post
    Real quick question, in your table, you said

    BA 12549 (from sheet 1)
    BA 12550 (sheet 2)

    Are those texts (from sheet 1) actually showing in that cell?
    quekbc, it is now working.. my problem now if it contains non-numerical data, example, Debit, Credit, etc
    it yield to #VALUE!

    and if the data with a zero(0) on the beginning of the number.
    example, BA 01234, BA 01235, etc.. using the formula you have provided, it results to 1234 instead of 01234

  22. #22
    Valued Forum Contributor quekbc's Avatar
    Join Date
    01-18-2010
    Location
    Sydney, Australia
    MS-Off Ver
    2010, 2013, 2016
    Posts
    1,149

    Re: finding MIN and MAX

    rcahayag1925, don't mind me. I was looking through SixthSense's solution and I thought that it seems to require the need of "(" within the table of data that you have. However, the IFERROR there seems to have already handled it.

    Although, if you can confirm/deny my earlier question, the formula can be simplified further.

    With regards to the numbers, you can change that using formatting. Right click on the cell, Format Cells, Number tab, select Custom, and type in Type: 00000.

  23. #23
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    Quote Originally Posted by quekbc View Post
    rcahayag1925, don't mind me. I was looking through SixthSense's solution and I thought that it seems to require the need of "(" within the table of data that you have. However, the IFERROR there seems to have already handled it.

    Although, if you can confirm/deny my earlier question, the formula can be simplified further.

    With regards to the numbers, you can change that using formatting. Right click on the cell, Format Cells, Number tab, select Custom, and type in Type: 00000.
    thank you, quekbc

  24. #24
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: finding MIN and MAX

    Quote Originally Posted by rcahayag1925 View Post
    excel 2003
    =max(if(iserr(value(trim(mid(trim(a1:a8)&" ",find(" ",trim(a1:a8))+1,if(iserr(find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1),255,find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1))))),0,value(trim(mid(trim(a1:a8)&" ",find(" ",trim(a1:a8))+1,if(iserr(find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1),255,find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1))))))

    =min(if(iserr(value(trim(mid(trim(a1:a8)&" ",find(" ",trim(a1:a8))+1,if(iserr(find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1),255,find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1))))),9^9,value(trim(mid(trim(a1:a8)&" ",find(" ",trim(a1:a8))+1,if(iserr(find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1),255,find("(",trim(a1:a8))-find(" ",trim(a1:a8))-1))))))

  25. #25
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: finding MIN and MAX

    or this (????) in Excel 2003 (array entered). I'll be amazed if it's OK for all situations as it's so short, by comparison with Sixthsense's formula, above!!

    Max =MAX(IF(ISERROR(--MID(A1:A8,FIND(" ",A1:A8)+1,255)),"",--MID(A1:A8,FIND(" ",A1:A8)+1,255)))

    Min =MIN(IF(ISERROR(--MID(A1:A8,FIND(" ",A1:A8)+1,255)),"",--MID(A1:A8,FIND(" ",A1:A8)+1,255)))



    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    It SEEMS to be OK.
    Attached Files Attached Files

  26. #26
    Registered User
    Join Date
    07-28-2015
    Location
    Japan
    MS-Off Ver
    Windows10, Microsoft Prof Plus 2019
    Posts
    84

    Re: finding MIN and MAX

    Quote Originally Posted by Glenn Kennedy View Post
    or this (????) in Excel 2003 (array entered). I'll be amazed if it's OK for all situations as it's so short, by comparison with Sixthsense's formula, above!!

    Max =MAX(IF(ISERROR(--MID(A1:A8,FIND(" ",A1:A8)+1,255)),"",--MID(A1:A8,FIND(" ",A1:A8)+1,255)))

    Min =MIN(IF(ISERROR(--MID(A1:A8,FIND(" ",A1:A8)+1,255)),"",--MID(A1:A8,FIND(" ",A1:A8)+1,255)))



    Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    It SEEMS to be OK.
    thank you, glenn..its working

  27. #27
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,419

    Re: finding MIN and MAX

    Glad to have helped! If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. It'd also be appreciated if you were to click the add Reputation button at the foot of any of the posts of those who helped you reach a solution.

+ 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] Finding specific data in cell comments and finding the line# in comments it appears on
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-11-2014, 04:26 PM
  2. Finding name then finding reoccurring numbers
    By top_dog in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-26-2014, 05:27 PM
  3. [SOLVED] Finding string not finding
    By sunswan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2013, 01:01 PM
  4. Macro Finding / Finding a Sheet containing
    By DakotaDK810 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2012, 12:17 AM
  5. Finding MAX value IF ?
    By kevin.denham in forum Excel General
    Replies: 1
    Last Post: 12-24-2011, 10:45 PM
  6. Replies: 10
    Last Post: 12-17-2009, 02:00 AM
  7. Replies: 3
    Last Post: 03-02-2007, 07:13 AM

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