ARRAY FORMULA (TEXTJOIN) periodically not updating or returning correct values

JPMAHONY

New Member
Joined
Jul 30, 2015
Messages
4
Hi,

I am using a TEXTJOIN function in an ARRAY FORMULA to return multiple matches to one cell.

However periodically the formula doesnt update and/or doesnt update correctly.

See formula in the attached - cell reference - D63

If you play with the inputs in cells L37:L39 - you will see that periodically they are not updating.

I have multiple sheets (per employee) and need to ensure that formula's are updated automatically.

At the moment, i need to press F2+enter to update

Can you please suggest a solution.

I have basic VBA knowledge.

Any help greatly appreciated.
 
Last edited:
This version handles those 2 cases as well:

VBA Code:
Function TextJoinX(sep As Variant, ign As Boolean, ParamArray SubArr() As Variant) As String
Dim i As Long, y As Variant, c As Long, separr() As String, sc As Long, f1 As Boolean
' Clone of TextJoin for versions of Excel prior to 2016
' 2016, Eric W, adapted from AConcat by Harlan Grove
' 2021, Added multiple separator support

    Application.Volatile
    TextJoinX = ""
    
    If TypeOf sep Is Range Then
        ReDim separr(0 To sep.Cells.Count - 1)
        c = 0
        For Each y In sep
            separr(c) = y.Value
            c = c + 1
        Next y
    ElseIf IsArray(sep) Then
        ReDim separr(0 To UBound(sep) - LBound(sep))
        c = 0
        For Each y In sep
            separr(c) = y
            c = c + 1
        Next y
    Else
        ReDim separr(0 To 0)
        If IsMissing(sep) Then
            separr(0) = ""
        Else
            separr(0) = sep
        End If
    End If
    c = 0
    sc = UBound(separr) + 1
    f1 = False
    
    For i = LBound(SubArr) To UBound(SubArr)
        If TypeOf SubArr(i) Is Range Then
            For Each y In SubArr(i).Cells
                If y = "" And ign Then
                Else
                    TextJoinX = TextJoinX & IIf(f1, separr(c Mod sc), "") & y.Value
                    c = IIf(f1, c + 1, c)
                    f1 = True
                End If
            Next y
        ElseIf IsArray(SubArr(i)) Then
            For Each y In SubArr(i)
                If y = "" And ign Then
                Else
                    TextJoinX = TextJoinX & IIf(f1, separr(c Mod sc), "") & y
                    c = IIf(f1, c + 1, c)
                    f1 = True
                End If
            Next y
        Else
            If SubArr(i) = "" And ign Then
            Else
                TextJoinX = TextJoinX & IIf(f1, separr(c Mod sc), "") & SubArr(i)
                c = IIf(f1, c + 1, c)
                f1 = True
            End If
        End If
    Next i
        
End Function

Be aware that there will likely be other discrepancies between this and the original TEXTJOIN, simply because the code is different, and I have no access to the original.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,224,870
Messages
6,181,493
Members
453,047
Latest member
charlie_odd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top