# Excel 2007 formula required

#### goyalsr

##### New Member
i have a table like this
BANKNIFTY
BANKNIFTY
BANKNIFTY
BANKNIFTY
BANKNIFTY
BANKNIFTY
NIFTY
NIFTY
NIFTY

i want to find address of the cell on which a text occurs first time and last time in a column.eg in above address of first row and sixth row in case of banknifty, and 7th row and 9th row in case of Nifty. i tried using match function , but it always gives last row number irrespective of my search.please note that data is very big ,above is just a part of that please guide.
I require this for calculation of option pain in a stock.

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### Ken Cowen

##### Board Regular
Assume data in column g rows 1 through 7

=MATCH(G1,\$G\$1:\$G\$7,FALSE) should give you the first one

=MATCH(G1,\$G\$1:\$G\$7) should give you the last one

I hope this helps.

Ken

#### Trebor76

##### Well-known Member
Hi goyalsr,

Welcome to MrExcel!!

Assuming the data starts at A1 and goes down column A (change to suit), put the following formula in Row 1 of any unused column...

...and copy it down to the last Row used in column A.

HTH

Robert

Last edited:

#### goyalsr

##### New Member
Assume data in column g rows 1 through 7

=MATCH(G1,\$G\$1:\$G\$7,FALSE) should give you the first one

=MATCH(G1,\$G\$1:\$G\$7) should give you the last one

I hope this helps.

Ken
Thanks sir for reply.As i my data is large so i treid
=MATCH(G1,G:G,FALSE)
=MATCH(G1,G:G)

however result is not matching, i think its matching only few alphabets.Please guide sir

#### goyalsr

##### New Member
Hi goyalsr,

Welcome to MrExcel!!

Assuming the data starts at A1 and goes down column A (change to suit), put the following formula in Row 1 of any unused column...

...and copy it down to the last Row used in column A.

HTH

Robert

Thanks sir for your kind response.Result is perfect sir, however i want result in two columns against each row, the first colum gives address of first occurrence and another
colum gives address of last occurrence.
Thanks

#### Trebor76

##### Well-known Member
Formula for first change:

Formula for last change:

#### goyalsr

##### New Member
Formula for first change:

Formula for last change:

Thanks Sir for your kind cooperation and Support

Replies
1
Views
64
Replies
0
Views
338
Replies
5
Views
309
Replies
1
Views
373
Replies
1
Views
490

1,181,251
Messages
5,928,923
Members
436,635
Latest member
mercessb

### 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.

### Which adblocker are you using?

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

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