Hello, I'm having trouble with a document that is used in several countries. It was made in the US and when using the computer's region and language format for English (United States), everything works as expected. Once it is changed or opened with Spanish (Mexico) settings, the VBA function does not output as expected. See the code below. I realize it is needlessly complicated, but it should still be counting correctly. The goal is to summarize a much larger table to show how many items in which phases are complete/overdue/upcoming. As soon as I switch the formats, one cell showing a count of 1 immediately changes to 0 upon recalculating. The issue seems to come from the red text line not reporting as true in the countifs function, but I'm not positive. I know that dates are formatted differently in the US (mm/dd/yyyy) vs. Mexico (dd/mm/yyyy), but I would think as long as they all change together, there wouldn't be a problem. I've been staring at this all morning, can anyone offer some advice?

Function DASHBOARDCOUNT(status As String, Phase As Long, ColumnRange As Range, WSName As String) As Variant

Dim ws As Worksheet, sum As Long
Set ws = ThisWorkbook.Worksheets(WSName)

If Phase < 1 Or Phase > 5 Then
    DASHBOARDCOUNT = "Phase Err"
    Exit Function
End If
For Each tbl In ws.ListObjects
    Select Case status
        Case "Green"
            Select Case Phase
                Case 1
                    sum = sum + Application.WorksheetFunction.CountIfs(tbl.ListColumns("Status").DataBodyRange, status, _
                        tbl.ListColumns("Actual Complete").DataBodyRange, "<=" & ThisWorkbook.Names("P1E").RefersToRange)
                Case 2, 3, 4
                    sum = sum + Application.WorksheetFunction.CountIfs(tbl.ListColumns("Status").DataBodyRange, status, _
                        tbl.ListColumns("Actual Complete").DataBodyRange, ">" & ThisWorkbook.Names("P" & Phase & "S").RefersToRange, _
                        tbl.ListColumns("Actual Complete").DataBodyRange, "<=" & ThisWorkbook.Names("P" & Phase & "E").RefersToRange)
                Case 5
                    sum = sum + Application.WorksheetFunction.CountIfs(tbl.ListColumns("Status").DataBodyRange, status, _
                        tbl.ListColumns("Actual Complete").DataBodyRange, ">" & ThisWorkbook.Names("P5S").RefersToRange)
            End Select

        Case "Red", "Yellow", "FGreen"
            sum = sum + Application.WorksheetFunction.CountIfs(tbl.ListColumns("Status").DataBodyRange, status, _
                tbl.ListColumns("Launch Phase").DataBodyRange, Phase)

        Case Else
            DASHBOARDCOUNT = "Status Err"
            Exit Function

    End Select
Next tbl

DASHBOARDCOUNT = sum

Set ws = Nothing
End Function