Mentor the last one worked, is there way to hard code the range into function? I will using this in a workbook loop on about 13k workbooks
Firstly, given the above, would you still be interested in a standard formula solution?
If so, let's consider this
Formula 1 returned 4, formula 2 returned 17. The text is BARGE "KIRBY 28180" currently in L2, but on different worksheets it could be in M2. The worksheets are different since it is from multiple vendors. When I look for blank cells using the f5 function and special selecting blanks it indicates that a cell L3 could contain a space since it was not shaded
If L3 does in fact contain a space (or spaces) then that would mean that "KIRBY 28180" is
not the only text in the range and would therefore account for the
#REF error because my formula was only expecting to find one thing in the range. So when it found 2 things, the first extra formula that I gave you in post 12 returned 4 and so my main formula was looking for the required value in row 4 of the H2:P4 range. Clearly that is not possible since that range only has 3 rows, hence the error. Similar with the other formula returning 17 when the H2:P4 range does not contain 17 columns.
However, if there is a space in L3 then the =COUNTIF(H2:P4,"?*") formula that I gave you in post 9 would not return 1 as you said in post 10. Perhaps you had a different data set then?
If you still have that data with "something" that is not visible in L3, what do these formulas return?
=CODE(L3)
=LEN(L3)
Would you "identification numbers" have a minimum length? That is, can we say that every identification number is at least 4 characters long? Or some other number?
If so, and any other stray cells containing spaces or whatever are less than 4 characters, then you could try this version
=INDEX(H2:P4,SUMPRODUCT((LEN(H2:P4)>3)*ROW(H2:P4))-ROW(2:2)+1,SUMPRODUCT((LEN(H2:P4)>3)*COLUMN(H2:P4))-COLUMN(H:H)+1)
Also, if you still have that data set with the "something" in L3, what happens if you delete "KIRBY 28180" from L2 and type "KIRBY 28180" into cell L4 and run Mentor's function on that data?
Finally, note that your idea of merging the whole range will fail if the identification number is in a row below or on the same row to the right of a cell like your L3.