Need help with simple macro - any help greatly appreciated

squnibi

Board Regular
Joined
May 26, 2010
Messages
74
Hi

I need help doing the following:

I have two columns in a spreadsheet, columns A and B. Column A has names and Column B has values. What I would like to do is sum up two specific values and then take the proportion of each to the whole.

For example I have names in one column and values in the next. I would like to sum up everything that starts with "Sample." There happens to be Sample 1 and Sample 2. Sample 1 has a value of 7,000 and Sample 2 has a value of 3,000. Therefore the proportion is 70% Sample 1 and 30% Sample 2. This is the first step.

The next step is to proportionate everything in the second sheet of the workbook. What I would like to be done is to take all values in columns B and C of the second worksheet which have the name "Sample 1" in column G and multiply by the 70% proportion.

The next step is to do the same to all values in columns B and C (of worksheet 2) which the name "Sample 2" in column G and multiply by the 30% proportion.

ANY HELP WOULD BE GREATLY APPRECIATED!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,527
Messages
6,179,351
Members
452,907
Latest member
Roland Deschain

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