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
- Smartsheet Customer Resources
- 63.6K Get Help
- 403 Global Discussions
- 215 Industry Talk
- 454 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 56 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!