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

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
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,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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