SOLVED

XLOOKUP returns #N/A using lookup_value from a formula, but not the same value directly

Copper Contributor

I have two columns in a lookup table:

0.00000.0075
0.05000.0050
0.10000.0025
0.11000.0000

 

Given the table is at A1:A4,B1:B4.

 

The formula XLOOKUP(0.1,A1:A4,B1:B4) returns 0.0025 as expected.

 

The formula XLOOKUP(0.75-0.65,A1:A4,B1:B4) returns #N/A. 0.0025 was expected.

 

All columns formatted as number.

2 Replies
best response confirmed by soarhevn (Copper Contributor)
Solution

@soarhevn That's due to minute rounding differences. Much is written about it. Mostly a lot of technical language on how computers perform calculations internally. When you notice it, use ROUND to fix it.

 

Change the formula like this: =XLOOKUP(ROUND(0.75-0.65,4),A1:A4,B1:B4)

 

 

1 best response

Accepted Solutions
best response confirmed by soarhevn (Copper Contributor)
Solution

@soarhevn That's due to minute rounding differences. Much is written about it. Mostly a lot of technical language on how computers perform calculations internally. When you notice it, use ROUND to fix it.

 

Change the formula like this: =XLOOKUP(ROUND(0.75-0.65,4),A1:A4,B1:B4)

 

 

View solution in original post