I’m looking for an elegant solution to a formula for the following criteria:
Location: Sheet2, ColumnB (row 2 onwards, the formula will be dragged down)
- highlight/ select value in ColumnA, same row
- search for selected value in Sheet1, ColumnA
- return the value in Column(?), same row as the selected value was located in ColumnA, Sheet1
- If no value is found, return 0 (zero)
- (?) can be determined by matching the value in B$1 (Sheet2, fixed value), with a value somewhere in rowK in Sheet1
The following is a code that does the job, but I think it’s quite inefficient, especially as this code is being used across thousands of cells. It is also difficult for my less-experienced collegaue to follow (this code is taken from cell B5 in Sheet2):
=IF(ISNA
(INDEX
('Sheet1'!$A:$HZ,
MATCH($A5),'Sheet1'!$A:$A,0),
MATCH(B$1,'Sheet1'!$22:$22,0))
)
,,
(INDEX
('Sheet1'!$A:$HZ,
MATCH($A5),'Sheet1'!$A:$A,0),
MATCH(B$1,'Sheet1'!$22:$22,0))
)
)
As always, any help would be much appreciated.
Regards,
Chris
Decided to keep it as-is in formula as I don’t want to lose visibility on the face of the worksheet. Thanks for all suggestions though – feel free to msg me if you have something better 😀