Reputation: 63
I'm setting up an excel file for the operators. They will scan the Barcode from the product and it will populate in one of the column of the excel sheet. I have tried using LOOKUP formula in excel but it doesn't seem to be working right.
COL A : Data from Database COL B : Data from Scanner COL C: Row number
Find the value of Column B in Col A and populate the Row no. in Column C.
=LOOKUP(B5,A:A,ROW(A:A))
I have used this formula in every cell of the column C.
The row number don't populate accurately.
Upvotes: 1
Views: 884
Reputation: 75930
=MATCH(B5,A:A,0)
should give you the rownumber. And if you wish to obtain the cell's address: =ADDRESS(MATCH(B5,A:A,0),1,4,1)
If you are using combined cells then you definiately want to use absolute ranges like =MATCH(B5,$A$5:$A$10,0)
Upvotes: 3
Reputation: 8230
Search B column in A column and get row back. You could use:
Note:
In my opinion there is no need to target whole range.
=IFNA(MATCH(B1,$A$1:$A$6,0)+ROW($A$1:$A$6)-1,"")
Results:
Upvotes: 1