pulling tax rate from another sheet

New Contributor

Hi, I'm trying to pull the tax rate from another sheet based on a match from a cell in the sheet I'm working from. So if the cell reference is found in the other sheet I want it to return the tax rate to the cell with the formula in it. I've tried XLOOKUP and Index/match and get nothing but the formula as a result. I don't even get an error.

=XLOOKUP(IF F2='Table 1'!A2:D589,Table 1'!,5)

F2 is the city I want the tax rate for

The range if in Table 1 which holds city, county, tax, etc

Column 5 is where the tax rate exists in Table 1


I'm retired and rusty, lol. Please help?

4 Replies


Assuming the data is converted to Excel Tables

=XLOOKUP([@OrderShipCity], TaxRateTbl[CITY], TaxRateTbl[RATE],"Not found")

will at least give a result.  Only the first occurrence of the city is looked up and some cities are missing.


Perhaps you mean

=XLOOKUP(F2,'Table 1'!C2:C589,'Table 1'!D2:D589, "tax not found")
best response confirmed by barb72 (New Contributor)


Here's a simpler formula that will work

=VLOOKUP(F2,'Table 1'!$C$2:$D$591,2,0)

As noted by Peter and Sergei, though, you have some cities missing from your table, so you'll get an #NA on occasion


You also need to convert the format of that cell (the whole column actually) to "number" or "general"--as you posted it, so presumably as you have it, it's formatted as "Text" and then will do exactly what it's been doing, show you your formula as text.


Thank you so much!!! That worked. I received the Paypal file from someone else and didn't even think to check the formatting on that column. It seems some of the cities are not in the other file so either Paypal made an error or my friend did when she downloaded it and removed all data except for GA. I'll have her double check it. I don't know where she got the list sheet from either so who knows, lol.

Thanks so much!!!