how determine rows

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » How to determine the rows where 2 equal numbers are in a column

How to determine the rows where 2 equal numbers are in a column

resolvedResolved · Medium Priority · Version 2013

How to determine the rows where 2 equal numbers are in a column

I have the following problem:

I have the following column in a table:

2
1
1
1
2
1
1
1
2
1
1

I need to find out the rows where the first and last "2" are. I can not change the table to sort it in ascending order.

I have used vlookup() to determine the first "2" but I don't know how to make excel look up this value starting on the last row and working its way to the first row. Can this be done? Or is there any other way I can find the row number where the last "2" is?

Thanks.

RE: How to determine the rows where 2 equal numbers are in a col

Hi Rita,

Thank you for the forum question.

You can do it using a combination of the Sumproduct, Max and Row function.

In the example below I have the numbers in the range A1:A13.

=SUMPRODUCT(MAX(ROW(1:13)*(A1:A13=2)))

If you want to find the row number for the first 2 you have in the range:

=MATCH(2,A1:A13,0)



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 27 Mar 2017: Automatically marked as resolved.


 


Server loaded in 0.09 secs.