Insert Rows and copy data

Dear Experts,

Kindly find an excel File attached.
I need to insert blank rows below each row based on a formula.
Then only non-blank data needs to be copied from Range1 to Range2

The File will clear everything.

Regards
EEE.xls
Kanwal_No2Self EmployedAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib Husain, SyedEngineerCommented:
Do you also need the colors copied or only the data?

Saqib
0
Kanwal_No2Self EmployedAuthor Commented:
Hi Saqib,

Only the Data.
Colour are only to show what data was copied where.

Thanks
0
Kanwal_No2Self EmployedAuthor Commented:
Hi Saqib,

R u there ?
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Saqib Husain, SyedEngineerCommented:
yes
0
Saqib Husain, SyedEngineerCommented:
Try this file

Saqib
EEE--Recovered-.xls
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kanwal_No2Self EmployedAuthor Commented:
Dear Saqib,

You certainly have done a lot of hard work and it seems to be paying off. Give me some time to try it.

Regards
Kanwal
0
Saqib Husain, SyedEngineerCommented:
Main intezaar karoonga
0
Kanwal_No2Self EmployedAuthor Commented:
Dear Saqib Bhai,

You have done a GREAT Job !
Thanks and Best of Luck to Dear Pakistan for the Indo Pak Semifinal
0
Kanwal_No2Self EmployedAuthor Commented:
Dear Saqib,

It indeed was a unique solution. I am also going to post the same question to try some VBA solution. You are welcome there too.

Regards
Kanwal
0
Kanwal_No2Self EmployedAuthor Commented:
Dear Saqib,

Though I have customized the formula to suit my requirements, but I am still intrigued by the finesse and would like to have a word from you about what the formulae are doing (Off course when you have time). I have seen in the past too producing you amazing formula and standard seems to have risen a lot.

Regards
Kanwal
0
Saqib Husain, SyedEngineerCommented:
**********   CCOONNGGRRAATTUULLAATTIIOONNSS  *********
0
Kanwal_No2Self EmployedAuthor Commented:
Thanks Saqib,

I know for what it is :)
But I heartily appreciate the fighting spirit shown by the Pak team to reach last 4. Today was just not their day. Till Mis-bah was there, everyone feared that he would take the Game away. Any way Hard luck this time. Best of luck for the future.

Regards
kanwal
0
Kanwal_No2Self EmployedAuthor Commented:
And yours formula is working wonders but I still couldn't fully grasp it...... Do drop a hint whenever you got the mood to do it.
0
Saqib Husain, SyedEngineerCommented:
A game should be treated as a game and not a matter of pride. One team has to win and the other has to lose. The only thing that matters is that it should be a good game played with sincerity.

Which formula are you referring to? Just ask what you want to know.
0
Kanwal_No2Self EmployedAuthor Commented:
Ditto.... I Agree.
Game is a game and emotions should be attached to the game only.

I am referring to the formula used by you in the file provided here. You seem to have used only two formulas to do a seemingly difficult task.
0
Saqib Husain, SyedEngineerCommented:
Column A

=IF(ISNUMBER(A1),
       IF(COUNTIF($A$1:A1,A1)<=OFFSET(INDIRECT(ADDRESS(ROW(MyRange),COLUMN(MyRange),,,"sheet1")),A1,33),
            Sheet2!A1,
            Sheet2!A1+1),
       1)

Each entry in this column depends upon the entry in its previous row. Either it repeats the previous entry or it adds 1 to it. Except for the first row where it must be 1.

Now to check whether to add 1 or not, I count the previous value in all the rows above the previous one and if it is not equal to the value found in the AH Column of sheet1 then keep the previous value. If it is equal then add 1

B to K
=IF(COUNTIF($A$1:$A2,$A2)=1,
       IF(OFFSET(INDIRECT(ADDRESS(ROW(MyRange),COLUMN(MyRange),,,"sheet1")),$A2,-1+COLUMN())="",
            "",
           OFFSET(INDIRECT(ADDRESS(ROW(MyRange),COLUMN(MyRange),,,"sheet1")),$A2,-1+COLUMN())),
       "")

If there is only one instance of the number in column A above and including the current row then print the value from sheet 1 otherwise leave blank.

L to N

=INDEX(Sheet1!$1:$1,
                 0,
                 SMALL(IF(OFFSET(Sheet1!$L$2,$A2,0,1,22)=0,
                                     99,
                                     COLUMN(OFFSET(Sheet1!$L$2,$A2,0,1,22))),
                                COUNTIF($A$1:$A2,$A2)))
This is an array formula and creates an array of column numbers where it finds a value. Then it uses the small to find the nth smallest number in this list.

I am sure this is not going to be sufficient to explain it all to you. But to get more out of me you would have to ask specific questions and I shall be glad to respond.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.