• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

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
0
Kanwal_No2
Asked:
Kanwal_No2
  • 9
  • 7
1 Solution
 
Saqib Husain, SyedEngineerCommented:
Do you also need the colors copied or only the data?

Saqib
0
 
Kanwal_No2Author Commented:
Hi Saqib,

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

Thanks
0
 
Kanwal_No2Author Commented:
Hi Saqib,

R u there ?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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

Saqib
EEE--Recovered-.xls
0
 
Kanwal_No2Author 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_No2Author 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_No2Author 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_No2Author 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_No2Author 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_No2Author 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_No2Author 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

  • 9
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now