Variation on calculating a Spiral

Crafty64

Board Regular
Joined
Aug 26, 2010
Messages
55
Hi, I've seen a couple of threads relating to creating a spiral where the starting point is from the middle - one elegant solution I saw was using the offset range property method.

My question is a variation on this theme. Given a number of rows and columns (say r = 4 and c = 5) how can the following output be achieved:


1 2 3 4 5 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

14 15 16 17 6<o:p></o:p>

13 20 19 18 7<o:p></o:p>

12 11 10 9 8<o:p></o:p>





So the 'Spiral' is working itself from the outside perimeter into the centre.
Any suggestions would be most helpful!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,538
Messages
6,179,412
Members
452,912
Latest member
alicemil

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