Counting locations for the first time only

montecarlo2012

Well-known Member
Joined
Jan 26, 2011
Messages
984
Office Version
  1. 2010
Platform
  1. Windows
Hello.
Where is the numbers of the column H at in the last time

Taking the B2:F2 as the last line.

And the counter will display the results on I

The numbers to be search are on column H

So for example number 1 is founded at number 9 position

For the first time, that’s all I want, no the second time



I would like this with any set of numbers.

To avoid complications I didn’t use the real data, instead

Letters are used.
Book1
ABCDEFGHI
1
2IMPACT LINEXXXXX19
39xxxx28
498xxx37
5x87xx46
6xx76x55
7xxx6564
8xxx4573
9xx34x82
10x23xx91
1112xxx
121NNNN
13
Sheet1
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Not pretty, but it works, provided your Excel version can use array formulas.

Book1
ABCDEFGHI
2IMPACT LINEXXXXX
39xxxx19
498xxx28
5x87xx37
6xx76x46
7xxx6555
8xxx4564
9xx34x73
10x23xx82
1112xxx91
121NNNN
Sheet5 (2)
Cell Formulas
RangeFormula
I3:I11I3=MATCH("*"&H3&"*",$B$3:$B$12&$C$3:$C$12&$D$3:$D$12&$E$3:$E$12&$F$3:$F$12,0)


Otherwise, this even less pretty alternative will work too.

Book1
ABCDEFGHI
2IMPACT LINEXXXXX19
39xxxx28
498xxx37
5x87xx46
6xx76x55
7xxx6564
8xxx4573
9xx34x82
10x23xx91
1112xxx
121NNNN
Sheet5
Cell Formulas
RangeFormula
I2:I10I2=MIN(IFNA(MATCH($H2,B$3:B$12,0),99),IFNA(MATCH($H2,C$3:C$12,0),99),IFNA(MATCH($H2,D$3:D$12,0),99),IFNA(MATCH($H2,E$3:E$12,0),99),IFNA(MATCH($H2,F$3:F$12,0),99))
 
Upvote 0
Another option.

Book1
ABCDEFGHI
1
2IMPACT LINEXXXXX19
39xxxx28
498xxx37
5x87xx46
6xx76x55
7xxx6564
8xxx4573
9xx34x82
10x23xx91
1112xxx
121NNNN
Sheet1
Cell Formulas
RangeFormula
I2:I10I2=AGGREGATE(15,6,(ROW($B$3:$B$12)-ROW($B$3)+1)/SEARCH(H2,$B$3:$F$12),1)
 
Upvote 0
Automatrix and AhoyNC, thank you so much for your time, and of course the formulas work, I really appreciate your time, the thing is I am expecting a code.
I tried something like this
VBA Code:
Sub distance()
With Range("B2:F12")
    Range("I2:I10").FormulaArray = "=AGGREGATE(15,6,(ROW($B$3:$B$12)-ROW($B$3)+1)/SEARCH(H2,$B$3:$F$12),1)"
  End With 
 End Sub
But, does not work, I am still waiting.
The other point is, my real data is different workbooks, and different sets of numbers, the reason why I rather code.
Thank you
 
Upvote 0

Forum statistics

Threads
1,215,028
Messages
6,122,753
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top