Forum Discussion

ExcelApprentice96's avatar
ExcelApprentice96
Copper Contributor
Oct 22, 2026

formulas

I'm trying to use the XLOOKUP formula and when trying I can use the 1 cell reference but can't use the whole column without excel popping up an error message about there being a problem with my formula. I even used the excel training video before coming here.

4 Replies

  • NathanReed's avatar
    NathanReed
    Iron Contributor

    XLOOKUP does accept whole-column references. If you’re looking up the value in D2 against column A and returning the corresponding value from column B, use:

    =XLOOKUP(D2,A:A,B:B,"Not found")

    Keep D2 as the single value you want to find. A and B are the columns Excel searches and returns from, and those ranges must have matching row counts.

    If Excel rejects the formula immediately, your regional settings may require semicolons:

    =XLOOKUP(D2;A:A;B:B;"Not found")

    If it still fails, paste your exact formula and the full error message. That will help distinguish a reference problem from a formula syntax issue.

  • The described behavior is correct, you can't use the whole column for the first argument. Excel throws an error message or generates a #SPILL error:

     

    But you can use a range of cells as first argument:

    The formula spills down and retruns the values you want. But if you add another Id in this example, the formula did not recognize it automatically. There are 2 ways to accomplish that:

    a) If you have Excel365 you can use a very large range and add a dot after the colon:

    The dot means: include all cells in A2:A10000 that have content => empty cells are ignored.

    b) If that doesn't work in your version of Excel, format the data as table and use just one cell as first argument:

    Don't forget to fix the cell references fo the other arguments with the $ sign! If you add more Ids the table expoands autoamtically and fills the formula down.

    If you have any further questions, do not hesitate to ask.

    Andreas.

  • Terio's avatar
    Terio
    Brass Contributor
    ExcelApprentice96 wrote:

    I'm trying to use the XLOOKUP formula

    Viewing your formula help us to help you.

    ExcelApprentice96 wrote:

    can't use the whole column without excel popping up an error message about there being a problem with my formula

    Be careful: the 2nd and 2rd parameters must be the same dimension; if you use the entire column as the search range, the return column must be an entire column and vice versa.

    Please post your attempt so that the correct solution can be suggested.

    Bye

  • VARSDigital's avatar
    VARSDigital
    Brass Contributor

    Whole columns are fine in XLOOKUP, so that popup usually means the column reference itself is written in a form Excel doesn't accept. This version works:

    =XLOOKUP(A2, Sheet2!A:A, Sheet2!B:B, "Not found")

    Two things set that message off most often. First, a range with no end row, like A2:A (the way Google Sheets writes it). Excel wants either the whole column, A:A, or both ends, A2:A500. Second, a sheet name with a space in it needs apostrophes around it: 'Price List'!A:A, not Price List!A:A.

    Keep the first argument as the one cell you're looking up (A2) and fill the formula down. The whole columns go in the second and third arguments. If the popup still shows, paste your exact formula here and we'll find the spot.

    (Drafted with AI assistance; formulas tested before posting.)