Need Help with Vlookup

NewTOvba26

New Member
Joined
Feb 17, 2017
Messages
15
Hi,

A----------------B
Country------20
Country------21
State----------15
State-----------12
County---------30


I have a table similar to this one. On a different sheet I am trying to pull columns B by matching column A using Vlookup. Problem is when I look up for country, it's pulling up the first value in B column. What I need is, if I am looking up for country then it should add up all the values for country i.e 71 total. Possible? Any help would be greatly appreciated. Thank you!
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Vlookup always return first item i.e. if you have country - 1, country - 2 and country - 3: lookup is always return 1 if you search by country so to proper useyou have to change country1, country2 and country3 like wise so that Vlookup can identify your crieteria.
 
Last edited:
Upvote 0
Try SUMIF, either of these two should do what you want.

=SUMIF($A$1:$A$5,"Country",$B$1:$B$5)
=SUMIF($A$1:$A$5,E1,$B$1:$B$5)

With the second formula referring to cell E1 which will have the text Country. (E1 could be a drop down with all the choices of the column A list.)

Given your small data sample, the formulas return 41, not 71, as you have two Country, two State and one County.

Howard
 
Upvote 0
Try SUMIF, either of these two should do what you want.

=SUMIF($A$1:$A$5,"Country",$B$1:$B$5)
=SUMIF($A$1:$A$5,E1,$B$1:$B$5)

With the second formula referring to cell E1 which will have the text Country. (E1 could be a drop down with all the choices of the column A list.)

Given your small data sample, the formulas return 41, not 71, as you have two Country, two State and one County.

Howard

Perfect. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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