Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions calc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14294,7 +14294,7 @@ func (fn *formulaFuncs) HLOOKUP(argsList *list.List) formulaArg {
matchIdx, wasExact = lookupBinarySearch(false, lookupValue, tableArray, matchMode, newNumberFormulaArg(searchModeAscBinary))
}
if matchIdx == -1 {
return newErrorFormulaArg(formulaErrorNA, "HLOOKUP no result found")
return newErrorFormulaArg(formulaErrorNA, formulaErrorNA)
}
if rowIdx < 0 || rowIdx >= len(tableArray.Matrix) {
return newErrorFormulaArg(formulaErrorNA, "HLOOKUP has invalid row index")
Expand Down Expand Up @@ -14488,7 +14488,7 @@ func (fn *formulaFuncs) VLOOKUP(argsList *list.List) formulaArg {
matchIdx, wasExact = lookupBinarySearch(true, lookupValue, tableArray, matchMode, newNumberFormulaArg(searchModeAscBinary))
}
if matchIdx == -1 {
return newErrorFormulaArg(formulaErrorNA, "VLOOKUP no result found")
return newErrorFormulaArg(formulaErrorNA, formulaErrorNA)
}
mtx := tableArray.Matrix[matchIdx]
if colIdx < 0 || colIdx >= len(mtx) {
Expand Down Expand Up @@ -14888,7 +14888,7 @@ func (fn *formulaFuncs) LOOKUP(argsList *list.List) formulaArg {
column = cols
}
if matchIdx < 0 || matchIdx >= len(column) {
return newErrorFormulaArg(formulaErrorNA, "LOOKUP no result found")
return newErrorFormulaArg(formulaErrorNA, formulaErrorNA)
}
return column[matchIdx]
}
Expand Down
28 changes: 14 additions & 14 deletions calc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3812,14 +3812,14 @@ func TestCalcCellValue(t *testing.T) {
"=HLOOKUP(D2,D1,1,FALSE)": "HLOOKUP requires second argument of table array",
"=HLOOKUP(D2,D:D,FALSE,FALSE)": "HLOOKUP requires numeric row argument",
"=HLOOKUP(D2,D:D,1,FALSE,FALSE)": "HLOOKUP requires at most 4 arguments",
"=HLOOKUP(D2,D:D,1,2)": "HLOOKUP no result found",
"=HLOOKUP(D2,D10:D10,1,FALSE)": "HLOOKUP no result found",
"=HLOOKUP(D2,D:D,1,2)": "#N/A",
"=HLOOKUP(D2,D10:D10,1,FALSE)": "#N/A",
"=HLOOKUP(D2,D2:D3,4,FALSE)": "HLOOKUP has invalid row index",
"=HLOOKUP(D2,C:C,1,FALSE)": "HLOOKUP no result found",
"=HLOOKUP(ISNUMBER(1),F3:F9,1)": "HLOOKUP no result found",
"=HLOOKUP(INT(1),E2:E9,1)": "HLOOKUP no result found",
"=HLOOKUP(MUNIT(2),MUNIT(3),1)": "HLOOKUP no result found",
"=HLOOKUP(A1:B2,B2:B3,1)": "HLOOKUP no result found",
"=HLOOKUP(D2,C:C,1,FALSE)": "#N/A",
"=HLOOKUP(ISNUMBER(1),F3:F9,1)": "#N/A",
"=HLOOKUP(INT(1),E2:E9,1)": "#N/A",
"=HLOOKUP(MUNIT(2),MUNIT(3),1)": "#N/A",
"=HLOOKUP(A1:B2,B2:B3,1)": "#N/A",
// MATCH
"=MATCH()": "MATCH requires 1 or 2 arguments",
"=MATCH(0,A1:A1,0,0)": "MATCH requires 1 or 2 arguments",
Expand All @@ -3836,13 +3836,13 @@ func TestCalcCellValue(t *testing.T) {
"=VLOOKUP(D2,D1,1,FALSE)": "VLOOKUP requires second argument of table array",
"=VLOOKUP(D2,D:D,FALSE,FALSE)": "VLOOKUP requires numeric col argument",
"=VLOOKUP(D2,D:D,1,FALSE,FALSE)": "VLOOKUP requires at most 4 arguments",
"=VLOOKUP(D2,D10:D10,1,FALSE)": "VLOOKUP no result found",
"=VLOOKUP(D2,D10:D10,1,FALSE)": "#N/A",
"=VLOOKUP(D2,D:D,2,FALSE)": "VLOOKUP has invalid column index",
"=VLOOKUP(D2,C:C,1,FALSE)": "VLOOKUP no result found",
"=VLOOKUP(ISNUMBER(1),F3:F9,1)": "VLOOKUP no result found",
"=VLOOKUP(INT(1),E2:E9,1)": "VLOOKUP no result found",
"=VLOOKUP(MUNIT(2),MUNIT(3),1)": "VLOOKUP no result found",
"=VLOOKUP(1,G1:H2,1,FALSE)": "VLOOKUP no result found",
"=VLOOKUP(D2,C:C,1,FALSE)": "#N/A",
"=VLOOKUP(ISNUMBER(1),F3:F9,1)": "#N/A",
"=VLOOKUP(INT(1),E2:E9,1)": "#N/A",
"=VLOOKUP(MUNIT(2),MUNIT(3),1)": "#N/A",
"=VLOOKUP(1,G1:H2,1,FALSE)": "#N/A",
// INDEX
"=INDEX()": "INDEX requires 2 or 3 arguments",
"=INDEX(A1,2)": "INDEX row_num out of range",
Expand All @@ -3869,7 +3869,7 @@ func TestCalcCellValue(t *testing.T) {
"=LOOKUP(D2,D1,D2)": "LOOKUP requires second argument of table array",
"=LOOKUP(D2,D1,D2,FALSE)": "LOOKUP requires at most 3 arguments",
"=LOOKUP(1,MUNIT(0))": "LOOKUP requires not empty range as second argument",
"=LOOKUP(D1,MUNIT(1),MUNIT(1))": "LOOKUP no result found",
"=LOOKUP(D1,MUNIT(1),MUNIT(1))": "#N/A",
// ROW
"=ROW(1,2)": "ROW requires at most 1 argument",
"=ROW(\"\")": "invalid reference",
Expand Down