+ Reply to Thread
Results 1 to 3 of 3

Power Query: Way to add an index column that counts 1-4 and repeats that pattern?

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Power Query: Way to add an index column that counts 1-4 and repeats that pattern?

    Is it possible to turn this
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10...

    into

    1
    2
    3
    4
    1
    2
    3
    4
    1
    2...

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Power Query: Way to add an index column that counts 1-4 and repeats that pattern?

    Hi BeaglesBuddy,

    Please Login or Register  to view this content.
    Add an Index column like normal and then add a custom column with a formula of:
    =Number.Mod([Index],4) +1

    https://msdn.microsoft.com/en-us/library/mt253344.aspx

    I think this is what you want.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Power Query: Way to add an index column that counts 1-4 and repeats that pattern?

    Quote Originally Posted by MarvinP View Post
    Hi BeaglesBuddy,

    Please Login or Register  to view this content.
    Add an Index column like normal and then add a custom column with a formula of:
    =Number.Mod([Index],4) +1

    https://msdn.microsoft.com/en-us/library/mt253344.aspx

    I think this is what you want.
    Thank you so much MarvinP!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error in power query & power pivot
    By Baldev Kumar in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-03-2018, 01:34 AM
  2. Power Query - add column with Table name
    By zico8 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-11-2017, 12:58 AM
  3. Return closest value less than given number matching another column - Power Query ?
    By ChipsSlave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2017, 03:16 PM
  4. Using weblink listed in excel column for Power Query
    By asha3010 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-05-2017, 10:18 AM
  5. Help with Power Query Custom Column Formula
    By travis.cook21 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-16-2016, 01:45 PM
  6. Replies: 6
    Last Post: 12-09-2012, 09:00 PM
  7. Replies: 3
    Last Post: 07-04-2008, 07:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1