Get a value if difference between two cells is more than 2

Tintoo

New Member
Joined
Oct 9, 2015
Messages
27
Am not good at macros and need experts here to help me.

Find below the sample data in sheet named ""[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]training 1[/TD]
[TD][/TD]
[TD]training 2[/TD]
[TD][/TD]
[TD]training 3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[/TR]
[TR]
[TD]res-1[/TD]
[TD]8[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]6[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]res-2[/TD]
[TD]9[/TD]
[TD]8[/TD]
[TD]8[/TD]
[TD]7[/TD]
[TD]9[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]res-3[/TD]
[TD]6[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]3[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]

Data to be populated in another sheet named "trainings required"

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-1[/TD]
[TD]training 1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-2[/TD]
[TD]training 3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-3[/TD]
[TD]training 1[/TD]
[TD]training 2[/TD]
[/TR]
</tbody>[/TABLE]

What is required:

If the difference between actual and goal is more than 2 then the heading "training 1" should be captured against the respective name in a new sheet. If its N/A then that cells can be skipped.

Contact me at mrsmart2309@gmail.com if any information is required

9
9
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Please someone help me.

Am not good at macros and need experts here to help me.

Find below the sample data in sheet named ""[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]training 1[/TD]
[TD][/TD]
[TD]training 2[/TD]
[TD][/TD]
[TD]training 3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[TD]goal[/TD]
[TD]actual[/TD]
[/TR]
[TR]
[TD]res-1[/TD]
[TD]8[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]6[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[/TR]
[TR]
[TD]res-2[/TD]
[TD]9[/TD]
[TD]8[/TD]
[TD]8[/TD]
[TD]7[/TD]
[TD]9[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]res-3[/TD]
[TD]6[/TD]
[TD]5[/TD]
[TD]8[/TD]
[TD]3[/TD]
[TD]N/A[/TD]
[TD]N/A[/TD]
[/TR]
</tbody>[/TABLE]

Data to be populated in another sheet named "trainings required"

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-1[/TD]
[TD]training 1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-2[/TD]
[TD]training 3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]res-3[/TD]
[TD]training 1[/TD]
[TD]training 2[/TD]
[/TR]
</tbody>[/TABLE]

What is required:

If the difference between actual and goal is more than 2 then the heading "training 1" should be captured against the respective name in a new sheet. If its N/A then that cells can be skipped.

Contact me at mrsmart2309@gmail.com if any information is required

9
9
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,122
Members
452,381
Latest member
Nova88

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