Forum Discussion

Paul_Cracknell's avatar
Paul_Cracknell
Copper Contributor
Sep 09, 2022
Solved

Help with repeating Week Numbers

Hi, all. I am trying to develop a table with week numbers that repeat 8 times before it moves on to the next week in the sequence. Is there a formulaic way to address this and make it efficient versus copy and pasting?

 

WeekCropBudget

1BROCCOLI 
1CAULIFLOWER 
1CELERY 
1GREEN LEAF 
1LETTUCE 
1RED LEAF 
1ROMAINE 
1SPINACH 
2BROCCOLI 
2CAULIFLOWER 
2CELERY 
2GREEN LEAF 
2LETTUCE 
2RED LEAF 
2ROMAINE 
2SPINACH 
  • If all you're asking about is the numbers, and assuming your first 1 is in cell A2 (i.e., the heading is in cell A1), then this formula entered into A3 and copied down will repeat numbers for eight rows and then go to the next.

     

    =IF(MOD(ROW(A2)-1,8)=0,A2+1,A2)

     

    If you also want the names of the Crops to repeat on the same cycle, we'll have to come up with a different formula and approach for that. Let us know. And how flexible (or not) do you want that to be? Might you want some kind of randomness in that?

     

    Perhaps the simplest way to do that, if you want to retain the exact sequence, is a simple IF in each line that says something like the following. You'd have to write each formula once, but from there on out it would just cycle through the names

     

2 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    If all you're asking about is the numbers, and assuming your first 1 is in cell A2 (i.e., the heading is in cell A1), then this formula entered into A3 and copied down will repeat numbers for eight rows and then go to the next.

     

    =IF(MOD(ROW(A2)-1,8)=0,A2+1,A2)

     

    If you also want the names of the Crops to repeat on the same cycle, we'll have to come up with a different formula and approach for that. Let us know. And how flexible (or not) do you want that to be? Might you want some kind of randomness in that?

     

    Perhaps the simplest way to do that, if you want to retain the exact sequence, is a simple IF in each line that says something like the following. You'd have to write each formula once, but from there on out it would just cycle through the names

     

Resources