Lookup then sum formula

lisa duncan

New Member
Joined
Jan 5, 2011
Messages
11
I need help with a formula that will lookup several different criteria then sum the result from a differnet column for example below are two columns I need to find all of the criteria in column A (cities and states) and sum column B : I have 260 cities and states to look through but need to sum only six.


<TABLE style="WIDTH: 177pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=235><COLGROUP><COL style="WIDTH: 101pt; mso-width-source: userset; mso-width-alt: 4900" width=134><COL style="WIDTH: 76pt; mso-width-source: userset; mso-width-alt: 3693" width=101><TBODY><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 101pt; HEIGHT: 15pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" id=td_post_2717586 class=xl173 height=20 width=134>Abbeville LA</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; WIDTH: 76pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl179 width=101 align=right>601874.50</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl173 height=21>Aberdeen WA</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl179 align=right>564900.86</TD></TR><TR style="HEIGHT: 15.75pt" height=21><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 15.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl173 height=21>Albany KY</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl179 align=right>278053.41</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl173 height=20>Alexandria LA HH</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl179 align=right>635333.75</TD></TR><TR style="HEIGHT: 15pt" height=20><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; HEIGHT: 15pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl173 height=20>Amarillo TX</TD><TD style="BORDER-BOTTOM: #d4d0c8; BORDER-LEFT: #d4d0c8; BACKGROUND-COLOR: transparent; BORDER-TOP: #d4d0c8; BORDER-RIGHT: #d4d0c8" class=xl179 align=right>1049488.92</TD></TR></TBODY></TABLE>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Are you familiar with SUMIF

=sumif(Range of city names,city you want to find, range of numbers you want to add up)

So, with two columns, A & B holding cities and Amounts respectively
I would put the following in cell E2, with cell D2 having the name of the city you want

=sumif($A$2:$A$261,D2,$B$2:$B$261)
 
Upvote 0
Excel Workbook
ABC
1Abbeville LA601874.5
2Aberdeen WA564900.86
3Albany KY278053.41
4Alexandria LA HH635333.75
5Amarillo TX1049488.92
6Abbeville LA47662
7Aberdeen WA302476
8Abbeville LA472343
9Aberdeen WA542717
10Abbeville LA468074
11Abbeville LA71019
12Aberdeen WA39536
13Albany KY422879
14Alexandria LA HH460291
15Amarillo TX927289
16
17
18
19
20Abbeville LA1660973
Sheet3
 
Upvote 0
I need one sum for all six criterias combined
Ok, try this...

List the criteria in a range of cells, say D2:D7.

Book1
ABCD
2783_1
3473_2
41573_3
5442_4
61324_5
7966_6
8860__
938_421
101123__
11645__
12649__
131139__
14365__
151036__
16995__
17279__
181266__
191137__
20660__
Sheet1

Then, this formula entered in D9:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A20,D2:D7,0))),B2:B20)
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,738
Members
452,940
Latest member
Lawrenceiow

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