Gopi
Gopi

Reputation: 369

How to compare to cells and return a particular cell value in the matched row in Excel

I am working on some classification task, but my data in both classes(class-0, class-1) is not balanced. so I added some synthetic data to make both classes balanced.

I performed some classification using the new data and now I have to remove the synthetic data to only retain the scores of Original Data to predict the accuracy of the model.

Here is some sample Data:

score   New Data             Original Data

0.004   (0.448038,0.696787) (0.242376,0.603979)

0.008   (0.207888,0.921134) (0.448038,0.696787)

0.001   (0.371334,0.498577) (0.436265,0.947961)

0       (0.242376,0.603979) 

0.001   (0.209049,0.909077) 

0       (0.436265,0.947961) 

Now the goal is to compare the cell contents in C column with B column and if a match is found, I need to collect the corresponding scores in A column

So, the desired output is:

score
0
0.004
0

to show clearly for reference the matching rows:

score   New Data             Original Data

0       (0.242376,0.603979) (0.242376,0.603979)

0.004   (0.448038,0.696787) (0.448038,0.696787)

0       (0.436265,0.947961) (0.436265,0.947961)

I have little experience with excel functions, Any help will greatly save my time.

Thanks,

Gopi

Upvotes: 0

Views: 84

Answers (1)

Scott Craner
Scott Craner

Reputation: 152450

In D2:

=INDEX(A:A,MATCH(C2,B:B,0))

Then copy/drag down.

enter image description here

Upvotes: 2

Related Questions