Hi
I am generating lots of read in one column
around over 1000, it is done using some addon
that is not the problem, the problem is how to count the change in the column
the column will only contain OPEN OR CLOSE
it could be either
CLOSE
CLOSE
CLOSE
OPEN
CLOSE
CLOSE
OPEN
OPEN
OPEN
CLOSE
so what I need to do it count the number of change of status
for this above example it would be 4 times it changed in entier so I need to findout the way to count the number of changes please help
Thank you
zit
Last edited by zit1343; 06-30-2011 at 01:18 PM.
If your range is in A1:A10, then try:
=SUMPRODUCT(--(A1:A9="Close"),--(A2:A10="Open"))+SUMPRODUCT(--(A1:A9="Open"),--(A2:A10="Close"))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
hey what if I do not know the limit is going up to,
it is different everytime
In a separate column, say in B1, enter formula:
=MATCH(REPT("z",255),A:A) this will get last row in column A that is occupied.
Then change formula to:
=SUMPRODUCT(--(A1:INDEX(A:A,$B$1-1)="Close"),--(A2:INDEX(A:A,$B$1)="Open"))+SUMPRODUCT(--(A1:INDEX(A:A,$B$1-1)="Open"),--(A2:INDEX(A:A,$B$1)="Close"))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
man you are awesome, I have only one problem
in A1 I have the Title.
is there a way to fix it ?
=MATCH(REPT("z",255),A:A)
Just adjust the formula accordingly:
=SUMPRODUCT(--(A2:INDEX(A:A,$B$1-1)="Close"),--(A3:INDEX(A:A,$B$1)="Open"))+SUMPRODUCT(--(A2:INDEX(A:A,$B$1-1)="Open"),--(A3:INDEX(A:A,$B$1)="Close"))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
nevermind I got it
thanx alot. let see where else do I get stuck
I fixed it by removing by $ sign
Last edited by zit1343; 06-30-2011 at 12:20 PM.
Perhaps you just need to move the $ from before the B's?
=SUMPRODUCT(--(A2:INDEX(A:A,B$1-1)="Close"),--(A3:INDEX(A:A,B$1)="Open"))+SUMPRODUCT(--(A2:INDEX(A:A,B$1-1)="Open"),--(A3:INDEX(A:A,B$1)="Close"))
If still not it, please post your workbook.
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
I removed "$" from $B$1 to B1-1
and it seems to be working any reason we need $ in front of 1
The $ "freezes" the column B and/or Row 1... so that when you copy across or down those don't change....
You can remove the $ before the 1 if you want, but if you copy the formula downwards, then beware that it will then reference B2, B3, B4, etc....
here is more on Absolute/Relative Referencing
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks