FIRST & LAST occurence

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
B2:B9999 contains NAMES
C2:C9999 contains values

Output required (D & E)
D2=First Occurrence of the C column (matching B)
E2=Last Occurrence of the C column (matching B)

How to accomplish?
Thanks in advance.
I am using Excel 2007

Sheet1

BCDE
Peter
James
England
Peter
England
England

<colgroup><col style="FONT-WEIGHT: bold; WIDTH: 30px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"><col style="WIDTH: 64px"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="align: right"]55[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]88[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="align: right"]5[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]77[/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]

[TD="align: right"]88[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]88[/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]

[TD="align: right"]99[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]77[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]

[TD="align: right"]77[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]77[/TD]

</tbody>
 
If there is a possibility that the range in column B greater (eg. B2:B20), then I suggest the following formula in cell G2
Code:
=SUMPRODUCT((B2:B20<>"")/COUNTIF(B2:B20,B2:B20&""))
This formula ignore blank cells

navic, will your formula check for 'complete' B column(B2:B99999) AND also ignore 'blank cells' of B column?
 
Upvote 0
Can there be a formula for above requirement which checks for 'complete' B column(B2:B99999) AND also ignore 'blank cells' of B column, if any?
 
Upvote 0

Forum statistics

Threads
1,226,907
Messages
6,193,600
Members
453,810
Latest member
Gks77117

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