Alternate cells so it's A-B-A-A-B-A-B-A-A-B...

ScreamingMidget

New Member
Joined
Mar 11, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
Ok, so currently I have content in Column A and Column B.

In Column D the contents of Col A and Col B are alternated as A-A-B ... A-A-B ... etc.

This is the formular I have so far for the original alternating:
=@INDEX($A$2:$B$3000,IF(MOD(ROWS(D$2:D2),3)<>0,ROWS($D$2:$D2)-INT(ROWS($D$2:$D2)/3)*1,INT(ROWS($D$2:$D2)/3)),1+(MOD(ROWS($D$2:$D2),3)=0))

I'm wanting changes so that it's displayed instead as A-A-B-A-B... A-A-B-A-B etc. So B is displayed more often.

Any idea what I'd need to change to the formula?

Col A: Red, Blue, Yellow, Pink
Col B: 1, 2, 3, 4, 5

At the moment Col D goes: Red, Blue, 1, Yellow Pink, 2

I want it to so it's Red, Blue, 1, Yellow, 2. Pink, 3
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
IF(MOD(ROWS(D$2:D2),3)<>0
becomes
IF(MOD(MOD(ROWS(D$2:D2),5),3)<>0

I'm not sure about the rest of it. If you posted a minisheet, I'd be able to make more sense of it.
 
Upvote 0
Welcome to the MrExcel Message Board!

Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Alternate data in columns A and B and input to Column D
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top