1

Im trying to compare every value from column A to each value individually from column E, and if one of the values from column A equals the value being compared from column E, put the value of the cell to the right of the matched value in column A to the cell to the right of the matched value in column E. I researched a bit and got close, but still having issues and not sure how to fix it. I have python programming experience, but have never used it with excel, so if thats the easiest solution, i can do that. This is a picture of my output.

enter image description here

This is a picture of the function I used.

enter image description here

I used Kutools to generate the function for me.

Thanks

teylyn
  • 34,374
  • 4
  • 53
  • 73

2 Answers2

2

This is just a pure excel formula and not really python but put this in F1 and drag it down as far as you need to

=INDEX(B:B,MATCH(E1,A:A,0))
1

You don't need Python for this and you don't need any tools to write the formula. It's a simple Vlookup. Since not all items in column E have a match in column A, you need to determine what to do in these cases. You can wrap the Vlookup into an IfError to catch the non-matches and return something nicer than #N/A. Also, you need to use absolute references for the lookup range, otherwise the range will change when the formula is copied down and the results may not be correct.

Try this

=iferror(vlookup(e1,$A$1:$B$324,2,false),"not found")

In words: try to find the value from E1 in column A and if an exact match is found, return the value from column B of the same row. If no match exists, return the text "not found".

teylyn
  • 34,374
  • 4
  • 53
  • 73