How to count the the last sequence of Xs in a column.
Thanks
How to count the the last sequence of Xs in a column.
Thanks
Hi prudential,
See if this formula does what you need after using a Helper Column.
=LOOKUP(2,1/($A$1:$A$6="X"),($B$1:$B$6))
Last X in Column Count String Helper.xlsx
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Hi Marvin, thanks for your help. Is there a way to do with without a helper column?
Hi,
If you knew the last string of X's was the largest number you might be able to use a Max function but I don't know of a way to do this problem without a helper. Maybe one of the smart Guru's will have a way?
There's no way to start the count from when there was no X?
Somthing similar to this - =LOOKUP(2,1/(A$1:$A$6<>""),$A1:$A$6)="X"
Last edited by prudential; 05-07-2018 at 10:17 AM.
Look at the formula in the helper column that does what I think you mean. Look at the different formula in B1 vs B2. I pulled the B2 column down to the bottom of the Column A rows.
Thanks but I really wanted to avoid creating a separate column. Once i figure this out it solves a much bigger problem and I can close 2 threads as solved.
Here are two formulas. Select suitable for you. PL see file.
=SUMPRODUCT(MATCH(2,1/(A1:A6="X"))-MATCH(2,1/(A1:A6<>"X")))
=MAX(SUMPRODUCT(MATCH(2,1/(D1:D6="X"))-MATCH(2,1/(D1:D6<>"X"))),0)
Pl note
Array formula should be confirmed with Ctrl+Shift+Enter keys together.
If answere is satisfactory press * to add reputation.
Try this one without helper column
Formula:
Please Login or Register to view this content.
If you like my answer please click on * Add Reputation
Don't forget to mark threads as "Solved" if your problem has been resolved
"Nothing is so firmly believed as what we least know."
--Michel de Montaigne
Hi kvsrinivasamurthy,
Your first formula above doesn't work if the last letter in a column is a "Y". I also can't make the second formula work for me. To test I've changed your formulas to include the entire column A. Then add letters to the bottom of the rows and see if it agrees.
Any improvements to your formulas? Am I missing something?
AlKey,
That's brilliant, thank you so much. That now solves this other problem as well.
https://www.excelforum.com/excel-for...m-a-range.html
Last edited by prudential; 05-07-2018 at 12:33 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks