Formula to Count a value and create Sequence number stops and repeats
In an source sheet we have list of countries. If India is twice and in destination sheet it is 6 times but the value I need it in sequence i.e., 1,2 and starts again from 1,2 and again 1,2. US is at 3 times in souce hence in destination sheet 1,2,3 and repeats.
Best Answer
-
You are going to need an auto-number column with no special formatting. Then you can use:
=IF(MOD(COUNTIFS([Country 2]:[Country 2], @cell = [Country 2]@row, Auto:Auto, @cell <= Auto@row), COUNTIFS(Country:Country, @cell = [Country 2]@row)) = 0, COUNTIFS(Country:Country, @cell = [Country 2]@row), MOD(COUNTIFS([Country 2]:[Country 2], @cell = [Country 2]@row, Auto:Auto, @cell <= Auto@row), COUNTIFS(Country:Country, @cell = [Country 2]@row)))
Answers
-
You are going to need an auto-number column with no special formatting. Then you can use:
=IF(MOD(COUNTIFS([Country 2]:[Country 2], @cell = [Country 2]@row, Auto:Auto, @cell <= Auto@row), COUNTIFS(Country:Country, @cell = [Country 2]@row)) = 0, COUNTIFS(Country:Country, @cell = [Country 2]@row), MOD(COUNTIFS([Country 2]:[Country 2], @cell = [Country 2]@row, Auto:Auto, @cell <= Auto@row), COUNTIFS(Country:Country, @cell = [Country 2]@row)))
-
@Paul Newcome Perfect Thanks lot.
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 141 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!