>1234⇒2341⇒3412⇒4123⇒1234
ができればできると思いますので、参考にしてください。
尚、列方向ではなく行方向の数式にしましたので悪しからず
_____ ____ _________________________________________________________________________________________________________ |_____|__A_|____________________________________________________B____________________________________________________| |___5_| 4 ←CountAの値とする |___6_| |___7_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |___8_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |___9_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__10_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__11_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__12_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__13_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__14_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__15_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__16_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__17_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__18_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__19_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__20_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__21_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__22_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__23_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__24_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__25_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__26_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__27_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__28_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__29_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__30_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__31_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__32_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__33_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__34_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__35_| 4 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__36_| 1 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__37_| 2 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |__38_| 3 =MID(MID(REPT(LEFT("123456789",A$5),99),INT((ROW()-ROW(A$7))/A$5)+1,A$5),MOD(ROW()-ROW(A$7),A$5)+1,1)*1 |