简体   繁体   中英

Identify Rows with Same Values in 2 Different Columns

I have a data set of roughly 405,000 rows and 23 columns. I need the records where the value in column "D" is the same as the value in column "H" for that row.

So for

A  B  C  D  E  F  G  H 
13 8 21 ok  3  S  - of
51 7 22 no  3  A  k no
24 3 23 by  3  S  * we
24 4 24 we  3  S  ! ok
24 9 25 by  3  S  @ we
75 2 26 ok  3  S  9 ok

etc...

I'd get back the 2nd row, the 6th row, etc...

A  B  C  D  E  F  G  H 
51 7 22 no  3  A  k no
75 2 26 ok  3  S  9 ok

Based on other posts like: Formula to find matching row value based on cells in multiple columns I tried using a Pivot Table, but it complains I can't put either of my two columns in the "Columns" area because there is too much data. With both columns in the "Rows" area, I get a relationship of D to H, but I can't then find a way to filter on only those where D = H.

I've also looked into countifs(), vlookup, and index / match functions, but I can't figure this out. Help please.

I would do a simple "IF()" formula in a new column.

For your example add a new column I and use the following formula in the first data row (I2):

=IF(D2=H2,"Yes","No")

Fill down to the end of the data.

Then using Excel filters or countif you can check the number of "Yes" vs "No" in your data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM