Post the table in as an Excel sheet or a table in an Access database and I'll build you a query, but I won't enter your data.
columns 2 and 3 involved embedded testing and because of their complexity, the result should be determined in functions (place code in a module), although they could be computed directly in the query:
Column2 field should be:
Code:
YourNameForColumn2: pfcnBuildCol2Aplha([Reference Number Value 1], [Reference Number Value 2], [Package Reference Number Value 1], [Package Reference Number Value 2])
Column 2 function
Code:
Public Function pfcnBuildCol2Alpha(Arg1 As String, Arg2 As String, Arg3 As String, Arg4 As String) As String
'is 1st character of any argument an alpha character
'pfcn prefix implies a public function
'convert 1st character to uppercase to avoid checking for lower case
'numeric 1st character will of course, not convert
If UCase(Left(Arg1, 1)) >= "A" And UCase(Left(Arg1, 1)) <= "Z" Then GoTo Alpha1
If UCase(Left(Arg2, 1)) >= "A" And UCase(Left(Arg2, 1)) <= "Z" Then GoTo Alpha2
If UCase(Left(Arg3, 1)) >= "A" And UCase(Left(Arg3, 1)) <= "Z" Then GoTo Alpha3
If UCase(Left(Arg4, 1)) >= "A" And UCase(Left(Arg4, 1)) <= "Z" Then GoTo Alpha4
'1st character is not an alpha character
pfcnBuildCol2Alpha = ""
GoTo Exit_Exit
Alpha1:
pfcnBuildCol2Alpha = Arg1
GoTo Exit_Exit
Alpha2:
pfcnBuildCol2Alpha = Arg2
GoTo Exit_Exit
Alpha3:
pfcnBuildCol2Alpha = Arg3
GoTo Exit_Exit
Alpha4:
pfcnBuildCol2Alpha = Arg4
Exit_Exit:
Exit Function
End Function
Column2 field should be:
Code:
YourNameForColumn3: pfcnBuildCol2Numeric([Reference Number Value 1], [Reference Number Value 2], [Package Reference Number Value 1], [Package Reference Number Value 2])
column 3 function
Code:
Public Function pfcnBuildCol3Numeric(Arg1 As String, Arg2 As String, Arg3 As String, Arg4 As String) As String
'is 1st character of any argument a numeric character
'pfcn prefix implies a public function
If IsNumeric(Left(Arg1, 1)) = True Then GoTo Numeric1
If IsNumeric(Left(Arg2, 1)) = True Then GoTo Numeric2
If IsNumeric(Left(Arg3, 1)) = True Then GoTo Numeric3
If IsNumeric(Left(Arg4, 1)) = True Then GoTo Numeric4
'1st character is not an Numeric character
pfcnBuildCol3Numeric = ""
GoTo Exit_Exit
Numeric1:
pfcnBuildCol3Numeric = Arg1
GoTo Exit_Exit
Numeric2:
pfcnBuildCol3Numeric = Arg2
GoTo Exit_Exit
Numeric3:
pfcnBuildCol3Numeric = Arg3
GoTo Exit_Exit
Numeric4:
pfcnBuildCol3Numeric = Arg4
Exit_Exit:
Exit Function
End Function
I'm sure that someone will come up with a better solution.