+ Reply to Thread
Results 1 to 10 of 10

Formula Conversion to Office 2016

Hybrid View

  1. #1
    Registered User
    Join Date
    09-12-2023
    Location
    Budapest
    MS-Off Ver
    Office 2016
    Posts
    18

    Question Formula Conversion to Office 2016

    Greetings!

    A friend of mine, who works in IT, created a formula for a problem that was also dealt with here, by some of the helpful moderators of this forum. However, contrary to the original information I had, our version of Excel is not the Microsoft 365, but the Office 2016.

    Is it possible to create a version of this formula for Office 2016?
    =TEXTJOIN(";"; FALSE; FILTER(TEXTSPLIT(A6;;";"; TRUE); ISNUMBER(MATCH(TEXTSPLIT(A6;;";";TRUE); F:F; 0)); "No matches"))

    A brief description of what the formula is supposed to do:

    It compares the leaders' names table with the contents of the cells in the teams column, and displays the leader names who are in those teams in the coordinators column - as it is presented in the linked sample sheet.SampleSheet.xlsx

    P.S.: I apologize to the moderators of this forum who worked with the incorrect information I have given. Your work is much appriciated and helped us greatly with understanding and hopefully solving the problem.
    Last edited by Dzekone; 09-18-2023 at 03:56 AM.

  2. #2
    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,226

    Re: Formula Conversion to Office 2016

    1. Are you allowed to use VBA?

    2. Is the use of helper column(s) allowed?
    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

  3. #3
    Registered User
    Join Date
    09-12-2023
    Location
    Budapest
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Formula Conversion to Office 2016

    Dear Glenn!

    Yes, both options are allowed!

  4. #4
    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,226

    Re: Formula Conversion to Office 2016

    Insert into a module:

    Public Function ConcatAll(ByVal varData As Variant, Optional ByVal sDelimiter As String = vbNullString, Optional ByVal bUnique As Boolean = False) As String
       
        Dim DataIndex As Variant
        Dim strResult As String
        
        If IsArray(varData) _
        Or TypeOf varData Is Range _
        Or TypeOf varData Is Collection Then
            
            For Each DataIndex In varData
                If Len(DataIndex) > 0 Then
                     If bUnique = True Then
                          If InStr(1, "||" & strResult & "||", "||" & DataIndex & "||", vbTextCompare) = 0 Then
                           trResult = strResult & "||" & DataIndex
                        End If
                    Else
                        strResult = strResult & "||" & DataIndex
                    End If
                End If
            Next DataIndex
            
            strResult = Replace(Mid(strResult, 3), "||", sDelimiter)
            
        Else
            strResult = varData
        End If
        
        ConcatAll = strResult
        
    End Function
    Then use this array formula (CTRL-SHIFT-ENTER), copied down:

    concatall(IF(ISNUMBER(MATCH($F$2:$F$6,FILTERXML("<A><B>"&SUBSTITUTE(A2,"; ","</B><B>")&"</B></A>","//B")&{""},0)),INDEX(F:F,ROW($F$2:$F$6)),""),"; ")
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-12-2023
    Location
    Budapest
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Formula Conversion to Office 2016

    Thank you, Glenn! I will try it and report back how it went!

  6. #6
    Registered User
    Join Date
    09-12-2023
    Location
    Budapest
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Formula Conversion to Office 2016

    Hey Glenn!

    I have attempted the solution you provided! Unfortunately, in spite of creating the VBA module and adding the array formula, the it doesn't seem to be working as well in my version as it did in yours. Would you mind taking a look at my worksheet to perhaps find a clue regarding where I went wrong?

    Thank you!

    Sample2.xlsx

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,291

    Re: Formula Conversion to Office 2016

    There is no UDF in that workbook.
    Remember what the dormouse said
    Feed your head

  8. #8
    Registered User
    Join Date
    09-12-2023
    Location
    Budapest
    MS-Off Ver
    Office 2016
    Posts
    18

    Re: Formula Conversion to Office 2016

    Hey Rory!

    What is a UDF and how do I include it in the workbook?

    Thanks!

  9. #9
    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,226

    Re: Formula Conversion to Office 2016

    1. You may have pasted the code into a module, but you have to save the file as macro-enabled (.xlsm). You saved it as an xlsx and the module was deleted.

    2. The formula was entered into a range of cells. It should have been entered into 1 cell with CTRL-SHIFT-ENTER and copied down.

    Now fixed.
    Attached Files Attached Files

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Australia
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,498

    Re: Formula Conversion to Office 2016

    Cell B2 formula , Drag down

    Formula: copy to clipboard
    =CustomConcatenate(A2,";",$F$2:$F$6)



    Function CustomConcatenate(lookupValue As String, delimiter As String, lookupRange As Range) As String
        Dim result As String
        Dim cell As Range
        Dim matchingValues As String
        result = ""
        For Each cell In lookupRange
            If InStr(1, lookupValue, cell.Value, vbTextCompare) > 0 Then
                matchingValues = matchingValues & cell.Value & delimiter
            End If
        Next cell
        If Len(matchingValues) > 0 Then
            matchingValues = Left(matchingValues, Len(matchingValues) - Len(delimiter))
        End If
        CustomConcatenate = matchingValues
    End Function

+ 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. Office 365 formula won't calculate in 2016
    By And180y in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-05-2021, 09:32 AM
  2. Replies: 1
    Last Post: 11-26-2020, 06:53 PM
  3. Replies: 4
    Last Post: 04-28-2019, 08:47 AM
  4. Replies: 1
    Last Post: 12-18-2016, 11:47 PM
  5. Replies: 1
    Last Post: 08-07-2016, 05:52 PM
  6. Replies: 2
    Last Post: 05-24-2016, 10:43 PM
  7. Conditional formatting with udf issues with Office 2016 / Office 365
    By andikeep2580 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2016, 10:58 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