#NAME error reported with cell formula

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have been relying on this worksheet with the formulae in column F for quite some time without issues.
As you can see from some of the data, the formula in column F has worked. But all of a sudden, I'm finding that if I change a value in either columns c or d, I get a #name error from the formula in column F. The formula doesn't appear any different that the results of those formulae in the other cells. I don't know why a change of the cell contents causes the formula to fail. Thoughts?

WS 23-Jul-21.xlsx
ABCDEF
2LEAD_SPKayla7:00 AM3:00 PMLDSP7:00A - 3:00P
3CRPPaul G.6:30 AM2:30 PMCU76:30A - 2:30P
4CWPKelly6:30 AM2:30 PMCU66:30A - 2:30P
5CUE1aErika7:00 AM3:00 PMCUA7:00A - 3:00P
6CUE1b12:00A - 12:00A
7CUE212:00A - 12:00A
8CUL1Chris V.1:00 PM10:30 PMCUB#NAME?
9CUL212:00A - 12:00A
10BPE1James7:00 AM3:00 PMBPA7:00A - 3:00P
11BPE212:00A - 12:00A
12BPL112:00A - 12:00A
13BPL212:00A - 12:00A
14HPE1Ethan D.7:00 AM3:00 PMHPA7:00A - 3:00P
15HPE212:00A - 12:00A
16HPL1Indigo1:00 PM9:00 PMHPC1:00P - 9:00P
17HPL212:00A - 12:00A
18RPE1Danielle7:00 AM3:00 PMRPA7:00A - 3:00P
19RPE212:00A - 12:00A
20RPL1Ethan W.1:00 PM9:00 PMRPC1:00P - 9:00P
21RPL212:00A - 12:00A
22WPE1Nicholas7:00 AM3:00 PMWPA7:00A - 3:00P
23WPE212:00A - 12:00A
24WPL1Owen2:30 PM10:30 PMWPC2:30P - 10:30P
25WPL212:00A - 12:00A
Staff
Cell Formulas
RangeFormula
F2:F25F2=_xlfn.TEXTJOIN(" - ",1,TEXT(C2,"H:MMA/P"),TEXT(D2,"H:MMA/P"))


The data you see is what was on the worksheet when the workbook was loaded. Row 8 illustrates the result when I changed the value in C8.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Looks like you are using the file in xl 2016 which doesn't have the textjoin function.
 
Upvote 0
Ah, that could be. I use 365 at home, but I guess here at school its an older version. Thanks Fluff!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Fear not @Ark68, If you want to use a UDF, (UserDefinedFunction), you can just replace your formulas and be back in business. :)

Copy the following code to a module in the workbook:

VBA Code:
Function TEXTJOINFunction(Delimiter As String, IgnoreBlank As Boolean, ParamArray arguments() As Variant) As Variant
'
    Dim Argument        As Double
    Dim tmpStr          As String
    Dim ArgumentType    As String
    Dim cel             As Variant
'
    For Argument = 0 To UBound(arguments)
        ArgumentType = TypeName(arguments(Argument))
'
        If ArgumentType = "Range" Or ArgumentType = "Variant()" Then
            For Each cel In arguments(Argument)
                If Not IgnoreBlank = True And Not cel = "" Then tmpStr = tmpStr & CStr(cel) & Delimiter
            Next
        Else
            If IgnoreBlank = True And CStr(arguments(Argument)) = "" Then
'               Blank found so skip this
            Else
                tmpStr = tmpStr & CStr(arguments(Argument)) & Delimiter
            End If
        End If
    Next
'
    If ArgumentType = "Error" Then
        TEXTJOINFunction = CVErr(xlErrNA)
    Else
        tmpStr = IIf(tmpStr = "", Delimiter, tmpStr)
        TEXTJOINFunction = Left(tmpStr, Len(tmpStr) - Len(Delimiter))
    End If
End Function

Then instead of your current formula where you see ',1,':

VBA Code:
=_xlfn.TEXTJOIN(" - ",1,TEXT(C2,"H:MMA/P"),TEXT(D2,"H:MMA/P"))

Use the following replacement formula that no longer needs the 'xlfn.' at the beginning of the formula, and uses ',TRUE,' instead of the ',1,' :

VBA Code:
=TEXTJOINFunction(" - ",TRUE,TEXT(C2,"H:MMA/P"),TEXT(D2,"H:MMA/P"))

Drag that formula down the column and you should be good to go!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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