Count in orderly manner

frappe

New Member
Joined
Sep 25, 2024
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Good day,

I have a table that needs to count the sequence.
Problem is formula to get the count in order -> VW, FW, SW, FWW, NTE
If the order is correct should have count as 5
1727237877399.png

But if when it went back to VW count should be 1.
1727237903495.png

Every time it goes back to VW it should count as 1.
1727237926031.png

The count should reflect in the yellow cell

Thank you
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
In the third example why isn't the count 5? The order is correct even though the 6th entry is VW.
 
Upvote 0
Try this:

Book1
ABCDEFG
1
25VW FW SW FWW NTE
31VW FW SW FWWVW
43 SW FW SWVW SWSW
Sheet1
Cell Formulas
RangeFormula
A2:A4A2=IFERROR(COUNTA(B2:J2)+1-MATCH(2,1/("VW"=B2:F2),1),0)
 
Upvote 0
Not sure but maybe this (change the range to suit):

Excel Formula:
=IF(TEXTJOIN(">",TRUE,B4:G4)="VW>FW>SW>FWW>NTE",5,1)
 
Upvote 0
Thanks Murray.

I did check here before I posted but you obviously can't always rely what the Internet say eh?

I would add another condition because if A to G are all blank your formula will return 5 where the following will return a blank which may suit the OP needs better:

Excel Formula:
=IF(COUNTBLANK(B4:G4)=6,"",IF(COUNTIF(B4:G4,"VW")>=0,1,5))
 
Last edited:
Upvote 0
I was working off Microsoft but you possibly can't rely on them either!
View attachment 117290
Microsoft only normally list the function appearing dates for versions they currently support, so if it was in an earlier version they normally wouldn't list it.
It isn't the case with TEXTJOIN though as it first appeared in 2019/365.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top