Macro to count and sum values paste in a table based on multiple criteria

Mavericks334

Active Member
Joined
Jan 26, 2011
Messages
280
Hi,

I have to sheets in an excel workbook. One has a table and the other has the data.

Below is the snapshot of the table and the data sheets.

Data sheet column headers:
MonthTIS Fund IDDescrDOMICILENAC FactorFAR Factor

<COLGROUP><COL style="WIDTH: 38pt; mso-width-source: userset; mso-width-alt: 1828" width=50><COL style="WIDTH: 64pt; mso-width-source: userset; mso-width-alt: 3108" width=85><COL style="WIDTH: 138pt; mso-width-source: userset; mso-width-alt: 6729" width=184><COL style="WIDTH: 141pt; mso-width-source: userset; mso-width-alt: 6875" width=188><COL style="WIDTH: 60pt; mso-width-source: userset; mso-width-alt: 2925" span=2 width=80><TBODY>
</TBODY>


Table information.
FY13
MonthOctNovDecJanFebMarAprMayJunJulAugSep
TIS number = 0
FAR Factor ID's = 0
FAR Factor >0
Sum of FAR Factor

<COLGROUP><COL style="WIDTH: 140pt; mso-width-source: userset; mso-width-alt: 6838" width=187><COL style="WIDTH: 26pt; mso-width-source: userset; mso-width-alt: 1280" width=35><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 1024" span=2 width=28><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 950" width=26><COL style="WIDTH: 21pt; mso-width-source: userset; mso-width-alt: 1024" width=28><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1060" width=29><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 987" width=27><COL style="WIDTH: 23pt; mso-width-source: userset; mso-width-alt: 1097" width=30><COL style="WIDTH: 20pt; mso-width-source: userset; mso-width-alt: 950" width=26><COL style="WIDTH: 17pt; mso-width-source: userset; mso-width-alt: 804" width=22><COL style="WIDTH: 22pt; mso-width-source: userset; mso-width-alt: 1060" span=2 width=29><TBODY>
</TBODY>


Based on the Month & fiscal year the macro should go respective column and update information.

It needs to check if TIS id's are 0 Then count them and paste in the TIS Number = 0 Section
Then it needs to go to the FAR Factor Column count all FAR factors ID's that are 0 except for the ones where TIS Number = 0 and paste the count in FAR id's section.
Then it should count all the non zero far factor id's and paste it in the FAR Factor > 0
and sum the same values and paste in the FAR Factor Section.

Could someone help me.

Regards,

Renato.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Forum statistics

Threads
1,203,182
Messages
6,053,974
Members
444,695
Latest member
asiaciara

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