return line number

Forum home » Delegate support and help forum » Microsoft Excel Training and help » return line number within a range

return line number within a range

resolvedResolved · Low Priority · Version 365

Chris has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel Intermediate course
Excel Dashboards for Business Intelligence course
Advanced Excel Dashboards course
Excel PowerPivot course
Excel Advanced - Formulas & Functions course
Excel Charting course

return line number within a range

I am trying to find a formula to put into column C to return the line line of a contract line item within the range of Customer ID (Row B). See desired result in row D. Thank you.

Customers ID Contract line No Contract line No desired result
6978 1
6978 2
6978 3
6978 4
6978 5
6978 6
6978 7
6979 1
6980 1
6981 1
6982 1
11081 1
11505 1
11557 1
14203 1
14614 1
14769 1
14944 1
14945 1
14946 1
15601 1
16006 1

RE: return line number within a range

Hi Chris,

Thank you for the forum question.

If you have column B sorted ascending or descending try:




=IF(B1=B2,C1+1,1)


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
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

RE: return line number within a range

Hi Chris,

Or even better (now column B doesn't need to be sorted)

=COUNTIF($B$2:B2,B2)



Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
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


 

Excel tip:

Add Text to Displayed Numbers in Excel 2010

To add text to a number in a cell, you need to go to the Home tab on the Ribbon, and click on the Cells group. Select Format Cells from the drop down menu then Custom from the Category list. In the Type box select General. After the word General, enter a space, then opening quotation marks, then the word you want to type and then closing quotation marks. Click on OK and you have your text!

View all Excel hints and tips


Server loaded in 0.11 secs.