insert cell content and shift cells down

G

Guest

i have a list of 4 periods from 1-4 located in cells B1 to B4 as follows

Period 1
Period 2
Period 3
Period 4

I would like the text TA inserted depending on the numeric value of Cell A1.
So if Al=2 TA would be inserted between Period 1 and Period 2 as follows:

Period 1
TA
Period 2
Period 3
Period 4

or if A1=3 the following would occur:

Period 1
Period 2
TA
Period 3
Period 4

I would perfer that a worksheet function accomplish this task rather than a
macro. Please help!
 
G

Guest

One formulas play venture ..

Assuming source data is placed like this in B1:B5

TA
Period 1
Period 2
Period 3
Period 4

Note: TA must be placed in the top cell (ie in B1).
The rest of the periods can be in any order within B2:B5

And you have in A1: 2
with the number denoting where you want the "TA" to be placed relatively

Put in C1:
=IF(B1="TA",A$1+ROW()/10^10,SUBSTITUTE(B1,"Period","")+ROW()/10^10)

Put in D1:
=INDEX(B:B,MATCH(SMALL(C:C,ROW()),C:C,0))
Select C1:D1, copy down to D5. Hide away col C.
D1:D5 will return the required results.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top