2 loops? got me spinning

J

John

I have States in column D and a percentage in column Z (on Data sheet). I
would like to loop through rows in the sheet and sum column Z for each state
in column D. The list of States is on worksheet States and column C.

For example... TX may show up twice on Data sheet and would like a sum for
the number in column Z for Texas. Can I put that total on the States sheet
in column D next to the state abbreviation?

Any help is appreciated
 
E

EricG

Probably don't need VBA for this. Type this formula into an empty next to
column D and drag down. Should do the summing you want for each state:

=SUMIF(Data!D2:D100,States!C2,Data!Z2:Z100)

Adjust the formula to suit your data and columns, then drag down to sum all
50 states.

HTH,

Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top