+ Reply to Thread
Results 1 to 7 of 7

Min/Max From Data with Variables & CONCAT

  1. #1
    Registered User
    Join Date
    02-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365, 2013 & Google Sheets
    Posts
    26

    Min/Max From Data with Variables & CONCAT

    Hi all, I've spent far to long trying to figure this out & getting nowhere.
    Attached sheet with data examples & desired results.

    I've been trying formulas along the lines of =IF(COUNTA($L$81:S81)=1,CONCAT($L$81:$S$81),CONCATENATE(MIN(L81:S81),"-",RIGHT(MAX($L$81:$S$81),3))) but this isn't working with the prefix.

    Dot points of variable data below,

    *Cells will either have a prefix or not, there should never be a scenario where some cells have a prefix & other do not.
    *The prefix may not always be the same letter.
    *Sometimes there will be 1 value, other times there will be multiple values.
    *If there is only 1 value, I just need to duplicate that value
    *If there are multiple values, I need the lowest value, in full including prefix as well as the last 3 digits of the highest value as per the examples in the attached sheet.
    *The values will not always be in sequential order.

    Any help would be appreciated as I've been going around in circles with this for a while now.

    Thanks,
    Attached Files Attached Files
    Last edited by AliGW; 07-15-2021 at 02:01 AM. Reason: Redacted for legibility.

  2. #2
    Forum Contributor
    Join Date
    12-13-2013
    Location
    Calgary,AB,Canada
    MS-Off Ver
    2016,O365
    Posts
    236

    Re: Min/Max From Data with Variables & CONCAT

    H2=IF(COUNTA(B2:F2)=1,LOOKUP(1,0/(B2:F2<>""),B2:F2),IF(ISERROR(MAX(B2:F3/1)),"A","")&MIN(SUBSTITUTE(B2:F2,"A",)/1)&"-"&TEXT(RIGHT(MAX(IFERROR(B2:F2/1,SUBSTITUTE(B2:F2,"A",)/1),3)),"000"))

    control+shift+enter

  3. #3
    Registered User
    Join Date
    02-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365, 2013 & Google Sheets
    Posts
    26

    Re: Min/Max From Data with Variables & CONCAT

    Close but not quite, thanks for the reply however.

    Your suggestion works with the example file but the issues is a variable prefix character. It will not always be "A", & to put another spin on things, there is a chance it will be more than 1 character but I don't see that being very likely.
    I'd like to think that 99% of the time, the prefix character will be the same for each data set i.e. all will start with "A" on this occasion, but the next time they might start with "C". On a very rare occasion, some will start with "A" while another will start with "D" in the same data set for example.
    Last edited by AliGW; 07-15-2021 at 01:20 AM. Reason: Unnecessary quotation removed,

  4. #4
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Min/Max From Data with Variables & CONCAT

    Please try

    =LEFT(LOOKUP("z",B2:F2),LEN(LOOKUP("z",B2:F2))-3)&TEXT(AGGREGATE(15,6,--RIGHT(B2:F2,3),1),"000")&REPT(TEXT(AGGREGATE(14,6,--RIGHT(B2:F2,3),1),"-000"),COUNTA(B2:F2)>1)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365, 2013 & Google Sheets
    Posts
    26

    Re: Min/Max From Data with Variables & CONCAT

    Still not 100% but good enough to move forward with the project. Thank you.

    The reason I saw it's still not right is due to the following hypothetical scenario,
    If the values are A00001, B00002 & C00003. The result shows C00001-003
    Last edited by AliGW; 07-15-2021 at 01:21 AM. Reason: Unnecessary quotation removed.

  6. #6
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,417

    Re: Min/Max From Data with Variables & CONCAT

    Are you still hoping for help? If not, please mark the thread as solved.

    In row 3 - why should DEF change to A? What's the logic there?

    What would you want to see returned for your new hypothetical situation?

    Finally, does this need to work on Excel 2013, or will it be used exclusively in a 365 environment?

    *If there is only 1 value, I just need to duplicate that value
    This rule is broken twice in your sample workbook!
    Last edited by AliGW; 07-15-2021 at 02:48 AM.
    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.

  7. #7
    Registered User
    Join Date
    02-20-2020
    Location
    Australia
    MS-Off Ver
    Office 365, 2013 & Google Sheets
    Posts
    26

    Re: Min/Max From Data with Variables & CONCAT

    For lack of a better definition, the values are somewhat of a shipping reference.

    If there is only 1 reference entered, I only need that reference duplicated. I cannot see how this is broken in the workbook attached assuming you are referring to rows 3 & 4?
    If there are multiple entries, I need the result to provide the full reference of the lowest sequential number with the last 3 digits of the highest, as if to say 00001 through to 00006 for example.

    I believe this sheet would only be used in the 0365 format but could be used both in desktop & web based versions.

    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. [SOLVED] extract last 3 numbers from each concat. value in col. B and add to col. A concat cells
    By therealdees in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-17-2021, 11:02 AM
  2. Concat spilled data
    By aguanigei in forum Excel General
    Replies: 5
    Last Post: 04-20-2020, 10:48 AM
  3. [SOLVED] Use CONCAT to pull data from different places
    By burrjc in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-29-2019, 03:40 PM
  4. Replies: 4
    Last Post: 04-09-2019, 09:28 PM
  5. [SOLVED] Concat String and Integer variables to create filename
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2014, 07:14 AM
  6. Concat column data in single cell with Matching ID
    By abhit_kumar in forum Excel General
    Replies: 7
    Last Post: 10-04-2012, 09:01 PM
  7. Concat variables
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2005, 01:05 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