I am looking for a formula that will look at the values in column "C" and return a sequential count of column "C" in column "D". The attached file should make my desired result much clearer.
JIm O
I am looking for a formula that will look at the values in column "C" and return a sequential count of column "C" in column "D". The attached file should make my desired result much clearer.
JIm O
Last edited by Jogier505; 02-14-2011 at 04:55 PM.
Try:
=IF(C2=C1,D1,D1+1)
copied down
or
=D1+(C2<>C1)
Last edited by NBVC; 02-14-2011 at 04:51 PM.
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
NBVC,
You are a god send. I have over 2000 rows to count and I was not looking forward to a manual count of any kind.
Thank you.
Jim O
You could try this user defined function.
Use =CountUniqueValues(C$2:C2) in Cell D2![]()
Function CountUniqueValues(MyRange As Range) As Long Dim MyArray() As String Dim Cell As Range Dim NewValue As Boolean Dim N As Long ReDim MyArray(0) For Each Cell In MyRange NewValue = True For N = 1 To UBound(MyArray) If MyArray(N) = Cell.Value Then NewValue = False Exit For End If Next N If NewValue = True Then ReDim Preserve MyArray(UBound(MyArray) + 1) MyArray(UBound(MyArray)) = Cell.Value End If Next Cell CountUniqueValues = UBound(MyArray) End Function
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks