98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum 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
Resolved · Medium Priority · Version 2013
Rita has attended:
Excel Advanced course
PowerPoint Intermediate Advanced course
Excel VBA Intermediate course
Word Advanced course
PowerPoint Intermediate Advanced course
Office 365 End User course
Office 365 End User course
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.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |