Search code examples
google-sheetsgoogle-sheets-formulaspreadsheet

XLOOKUP with multiple criteria always gives array size error


I can never get XLOOKUP to work with multiple criteria. All I ever get is "Array arguments to XLOOKUP are of different size" no mater what data set I use.

Eventually I want to use this in a work center/product type lookup that will be something like "Metal work & Soldering" to get something like items per FTE day = 20

Working in Google Sheets. What am I doing wrong? Thanks

[[[enter image description here](https://i.sstatic.net/pbUqY.jpg)](https://i.sstatic.net/xwkn3.jpg)](https://i.sstatic.net/yPMDw.jpg)

Column A Header: Item 1 Ships Cars Airplanes Motorcycles

Column B Header: Item 2 Water Roads Sky Roads

Column C: Header: Price 300 50 120 20

Criteria 1/Cell F1: Cars Criteria 2/Cell F2: Roads

Formula: =XLOOKUP(F1&F2,A2:A5&B2:B5,C2:C5)

Desired result: 50 Actual result: #N/A Array arguments to XLOOKUP are of different size


Solution

  • You need an arrayformula or index wrapped around the 2 columns you were concatenating A2:A5&B2:B5 otherwise the result is just goin' to be A2&B2 which obviously has just one row data compared to C2:C5 with 4 rows of data thus resulting in different size error

    try: xlookup(F1&F2,index(A2:A5&B2:B5),C2:C5,)