Index Match using Tables in Google Sheets not giving correct results

I have set up a sample sheet at https://docs.google.com/spreadsheets/d/1i3ZCE_9IvVyhrb-uK-ofMT3f0H_En1SfLSjbC8oyZlk/edit?gid=1600420249#gid=1600420249.

If I obtain the MATCH in a column and then use the match value in an Index function, I get the right results.
However, if I use the INDEX and MATCH together, the results are incorrect.

I am using the column names to refer to the cells. I am using the Tables feature that is introduced in Gsheets , similar to the feature in Excel. How to fix this?

If I use the cell reference, the index-match works fine as shown in the Expected column.

4

The issue is caused by the evaluation of a range in an array enabled formula.

You’re getting the row index with this pattern:

match(Employees[Name], Employees[Name], 0)

When that is tested as a formula of its own, it gets the expected result. The first instance of Employees[Name] is evaluated to the current row in the table, and the formula gets just one result.

The index() function, however, array enables its parameters. In this context, the match() will go through all of the rows in the first parameter getting a vertical array of values, and match every one of those values to the column, which gives an array of results instead of a single result.

To make it work, move the match() out of the index(), so that it only returns one result, like this:

=let( 
  i, match(Employees[Name], Employees[Name], 0), 
  index(Employees[Name], i) 
)

Index-match is a legacy pattern. For most applications, it is easier to use functions like
query(),
filter(),
scan() or
chooserows().

Using Index and Match

Based on the current setup of your table, you are using an array as the search key. Adding [#This Row] to the formula will ensure it processes the values of the current row instead of the entire array.

You can try this formula:

=INDEX(Employees[Name], MATCH(Employees[[#This Row],[Name]],Employees[Name],0))

Sample Output:

Note: Simply drag the formula down.

1

Try this simple approach first;

Named ranges are properly defined:

Go to Data > Named ranges in Google Sheets and verify that your column names are correctly set up as named ranges.

Explicitly refer to the named ranges in both MATCH and INDEX:

Example;

” =INDEX(DataRange, MATCH(TargetValue, LookupRange, 0), ColumnIndex) “

Else Try this approach;

Double-check named ranges: Ensure that your named ranges correspond precisely to the intended columns (e.g., the ID column should only include IDs).

For MATCH, use single-column ranges like Name, not entire arrays.
Reconstruct the INDEX-MATCH Formula Using Named Ranges: Rewrite the formula explicitly to ensure compatibility. For example:

” =INDEX(Totals, MATCH(Name in current row, Name, 0)) “

Totals should be the named range corresponding to the column where you want to retrieve data.
Name should be a single-column range where MATCH looks for Name in current row.

If it still doesn’t match try this approach;

Temporarily replace the named ranges with direct cell references to ensure the logic is sound:

” =INDEX(A2:A10, MATCH(B2, B2:B10, 0)) ” #Check the named range definitions for potential discrepancies.

The condition in the FILTER function is always TRUE that’s why you get all the ROWS

ROWS(FILTER(Employees[Name],Employees[Name]=Employees[Name]))

I suggest you use

COUNTIF(Employees[Name], $B2)

in the first row and fill down the other cells bellow.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật