问题
I am trying to vlookup (bring back) all the products that are yes, but only the first result keeps coming back because the vlookup gets stuck on the first piece of data.
I am using much more data than the range below but please see below as example.
A1 = Yes B1 = Product 1
A2 = Yes B2 = Product 2
A3 = Yes C3 = Product 3
=vlookup("Yes",$A$1:$C$3,2,false)
It works if I take out the $ signs but then I just get repeat values.
I am guessing this needs a different function but am unsure what to use.
Thanks
Ian
回答1:
Check this link and understand how that formula works. In your example, put this formula into cell D2 and press CTRL+SHIFT+ENTER and fill down using mouse:
=IFERROR(INDEX($B$1:$B$12, MATCH(0,IF("yes"=$A$1:$A$12,COUNTIF($D$1:D1, $B$1:$B$12),""), 0)),"")
来源:https://stackoverflow.com/questions/40487435/vlookup-text-that-is-not-unique-excel