append to existing rows based on conditions

OldStudent

New Member
Joined
Mar 23, 2016
Messages
2
I would like to append rows to existing rows based on simple conditions.
If the saccade number in the second sheet resets to one, I would like to append it to the original sheet, starting with the next fixation

Sheet #1
[TABLE="width: 500"]
<tbody>[TR]
[TD]Fixation[/TD]
[TD]#[/TD]
[TD]XDAT[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]4[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]6[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]7[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]8[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]9[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10[/TD]
[TD]200[/TD]
[/TR]
</tbody>[/TABLE]

Sheet #2
[TABLE="width: 500"]
<tbody>[TR]
[TD]saccade[/TD]
[TD]Data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]145[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]156[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]145[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]130[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]120[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]125[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]130[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]140[/TD]
[/TR]
</tbody>[/TABLE]

DESIRED OUTCOME :)

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]Fixation[/TD]
[TD]#[/TD]
[TD]XDAT[/TD]
[TD]saccade[/TD]
[TD]data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]200[/TD]
[TD]1[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2[/TD]
[TD]200[/TD]
[TD]2[/TD]
[TD]145[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3[/TD]
[TD]200[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]4[/TD]
[TD]200[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]5[/TD]
[TD]200[/TD]
[TD]1[/TD]
[TD]156[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]6[/TD]
[TD]200[/TD]
[TD]2[/TD]
[TD]145[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]7[/TD]
[TD]200[/TD]
[TD]3[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]8[/TD]
[TD]200[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]9[/TD]
[TD]200[/TD]
[TD]1[/TD]
[TD]130[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]10[/TD]
[TD]200[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I have tried using an if and statement, but have had no luck so far.

Thank you in advance for your help.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,223,888
Messages
6,175,208
Members
452,618
Latest member
Tam84

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