+ Reply to Thread
Results 1 to 3 of 3

Formula that will enter text into a loop of cells

  1. #1
    Registered User
    Join Date
    04-13-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Formula that will enter text into a loop of cells

    I have four cells in a row, A1:A4. I have another cell B1 that's linked to a form scroll bar. So each time I increment the scroll bar cell B1 increments upwards by 1.

    So what I'm trying to get in A1:A4 is hard to describe... I want an "X" to move repeatedly through the four cells, A1 to A2, A2 to A3, A3 to A4, and then form A4 back to A1, and repeat... so here's another way to describe it.

    If B1 = 1 then put an "X" in A1
    If B1 = 2 then put an "X" in A2
    If B1 = 3 then put an "X" in A3
    If B1 = 4 then put an "X" in A4
    If B1 = 5 then put an "X" in A1
    If B1 = 6 then put an "X" in A2
    If B1 = 7 then put an "X" in A3
    etc, etc, etc....

    Is there a formula that I can use to make this work? I actually have a series of 63 cells that I'm trying to cycle an "X" through. But I'm hoping if I can understand the formula for four cells, then it will hold true for 63 also.

    Appreciate any help or insights into such a formula!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Formula that will enter text into a loop of cells

    Try these formulas:

    A1: =IF(MOD($B$1,4)=1,"X","")
    A2: =IF(MOD($B$1,4)=2,"X","")
    A3: =IF(MOD($B$1,4)=3,"X","")
    A4: =IF(MOD($B$1,4)=0,"X","")



    To do it for 63 cells, I would use this in the first 62:
    A1: =IF(MOD($B$1,63)=ROW(),"X","")

    And in A63:
    =IF(MOD($B$1,63)=0,"X","")
    Last edited by JBeaucaire; 07-01-2009 at 09:20 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    04-13-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Formula that will enter text into a loop of cells

    Thanks very much JBeaucaire. I will plug these formulas in later tonight and post back how it turns out. Your speedy reply is greatly appreciated!

    Yep... it worked. Thanks again!
    Last edited by Hotmail; 07-02-2009 at 04:22 AM. Reason: Verified the formula worked

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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