Find 2nd instance of a word in a range.
If FEB is defined as A2:G2, try this:
K1: =SMALL(IF((NAMES 1:1)=FEB,COLUMN(FEB)),2)
Note: Commit that array formula by holding down the [Ctrl] and [Shift] keys
when you press [Enter].
Copy down as far as needed.
Note: That formula returns the Column Number of the 2nd occurrence, not the
relative position in the range. To get that, you'd need to subtract the
number of columns that preceed the defined range.
Does that help?
***********
Regards,
Ron
"Grumpy Grandpa" wrote:
I need a formula that will tell me the 2nd time a word appears in a
range.
Assume I have three ranges of cells in B1:G1, B2:G2, and
B3:GErespectfully, with the following names in the cells:
A B C D E F G
1 JAN Smith Jones Burch March Jones Bills
2 FEB Jones Burch March Jones Bills Smith
3 MAR Burch March Jones Bills Bills Smith
The first range, I've named "JAN", the second one "FEB" and the third
one "MAR".
In another part of the worksheet I have these names entered in a
column. Let's say in J1:J5. I've named the range J1:J5 "NAMES" and I
want to display in K1:K5 the 2nd time in range FEB that each name shows
up. What w/should my formulas in K1:K5 need to look like?
J K
1 Bills =???
2 Burch =???
3 Jones =???
4 March =???
5 Smith =???
I've started with a formula in K1, for example, that looks like this:
=INDEX(INDIRECT(A2),1,MATCH(J1,NAMES,0))
But, that only finds the first instance that the name shows up. I don't
know how to tell it to find the 2nd instance of the name in the range.
Any help would be greatly appreciated.
|