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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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