Need help with this macro

ChiTown

New Member
Joined
Mar 31, 2011
Messages
16
Hello,

I have 2 columns. One with zipcodes and one with numbers that have a count (sorted) highest to lowest like so:

90210 192
90217 168
90219 152
(on and on)

I have 2 source files yet they have different opinions about the count.

So source A states:

90210 192

Yet source B states:

90210 178

What I want to do is add the sum of 192 and 178 then divide by 2 to give me the sum count and final rank based on that sum.

In this case 192+178=370/2 = 185

The layout (or mapping?) will be:
columns
A B C D E
source A zip source A count source B zip source b count sum count

F
final rank

An example would be
A B C D E F
90210 192 90210 178 370 1

Please note that the columns that contain the zips are not in the same row. An example would be:

A B
90210 90219
90217 90210
90219 90217

(So this macro needs to match the zip codes before they can I add them)

(Using Excel 2007)

Can someone please give me the macro for this?
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,224,521
Messages
6,179,278
Members
452,902
Latest member
Knuddeluff

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