Number intervals - positive to negative

froggeja

New Member
Joined
May 30, 2014
Messages
26
I have six columns and 15,625 rows. My data is working with combinations of +2 to -2.

In column A, I want to sequence my input data as +2,+1,0,-1,-2 and then repeat until row 15,625

In column B, I want to sequence it as five +2s, then five +1s, then five 0s, then five -1s, then five -2s.

In column C, I want to sequence it as 25 +2s, then 25 +1s, then 25 0s, then 25 -1s, then 25 -2s.

In column D, I want to sequence it as 125 +2s, then 125 +1s, then 125 0s, then 125 -1s, then 125 -2s.

In column E, I want to sequence it as 625 +2s, then 625 +1s, then 625 0s, then 625 -1s, then 625 -2s.

In column F, I want to sequence it as 3,125 +2s, then 3,125 +1s, then 3,125 0s, then 3,125 -1s, then 3,125 -2s.

This will create a permutations matrix of 15,625 outcomes of six questions with 5 answers each.

I think I need to modify these formulas:
=MOD(ROWS($A$1:$A1)-1,5)+1
=MOD((INT((ROWS($A$1:$A1)-1)/5)+1)-1,5)+1
=MOD((INT((ROWS($A$1:$A1)-1)/25)+1)-1,5)+1
=MOD((INT((ROWS($A$1:$A1)-1)/125)+1)-1,5)+1
=MOD((INT((ROWS($A$1:$A1)-1)/625)+1)-1,5)+1
=MOD((INT((ROWS($A$1:$A1)-1)/3125)+1)-1,5)+1


Hope you can help!
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Try wrapping each of your formulas within a LOOKUP() as follows:
=LOOKUP(YourFormula,{1,2,3,4,5},{-2,-1,0,1,2})
 
Upvote 0
An alternative: In A1 and copy down and right,

=MOD(INT(5 * (ROWS($A$1:A1) - 1) / 5 ^ COLUMNS($A$1:A1)), 5) - 2

Row\Col
A​
B​
C​
D​
E​
F​
1​
-2​
-2​
-2​
-2​
-2​
-2​
2​
-1​
-2​
-2​
-2​
-2​
-2​
3​
0​
-2​
-2​
-2​
-2​
-2​
4​
1​
-2​
-2​
-2​
-2​
-2​
5​
2​
-2​
-2​
-2​
-2​
-2​
6​
-2​
-1​
-2​
-2​
-2​
-2​
7​
-1​
-1​
-2​
-2​
-2​
-2​
8​
0​
-1​
-2​
-2​
-2​
-2​
9​
1​
-1​
-2​
-2​
-2​
-2​
10​
2​
-1​
-2​
-2​
-2​
-2​
11​
-2​
0​
-2​
-2​
-2​
-2​
12​
-1​
0​
-2​
-2​
-2​
-2​
 
Upvote 0
Wow - that's superb. This works too and deals with the issue of my original hardcoded formula. Thanks.
 
Upvote 0
Is it possible to modify the formula (=MOD(INT(5 * (ROWS($A$1:A1) - 1) / 5 ^ COLUMNS($A$1:A1)), 5) - 2) so the data in column A, for instance, ranks:
2
1
0
-1
-2
2
1
0
-1
-2
etc,.

thanks
 
Upvote 0
Reverse the =MOD()-2 like this:
=2-MOD(INT(5 * (ROWS($A$1:A1) - 1) / 5 ^ COLUMNS($A$1:A1)), 5)

Alternatively, put a minus sign in front, like this:
= -(MOD(INT(5 * (ROWS($A$1:A1) - 1) / 5 ^ COLUMNS($A$1:A1)), 5) - 2)
 
Upvote 0

Forum statistics

Threads
1,215,179
Messages
6,123,495
Members
449,100
Latest member
sktz

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