SUMIFS, VLOOKUP Formula

blackmajik072

New Member
Joined
Jul 18, 2018
Messages
3
Hi folks,

I'm trying to figure out a formula which will do a lookup of a region to find cities to sum sales in an associated table. I can manually do this by hard coding SUMIFS statements. However this is not scalable and will be too difficult to maintain before long. Any ideas on how I might achieve this? Many thanks.

Sales by Region
RegionJanFebMar
East259734
West122022
North341318
South204751
Total91177125

<tbody>
</tbody>












Region/City Lookup Table
RegionCity
EastSydney
NorthBrisbane
SouthHobart
EastNewcastle
WestPerth
SouthMelbourne
NorthGold Coast
WestBroome

<tbody>
</tbody>















Sales by City
CityJanFebMar
Broome101514
Melbourne204751
Gold Coast341318
Sydney114312
Newcastle145432
Perth258

<tbody>
</tbody>
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
CityJanFebMar
Broome101514
Melbourne204751
Gold Coast341318
Sydney114312
Newcastle145432
Perth258

<tbody>
</tbody>

1. Select the entire area and name the selection DATA.

RegionCity
EastSydney
NorthBrisbane
SouthHobart
EastNewcastle
WestPerth
SouthMelbourne
NorthGold Coast
WestBroome

<colgroup><col><col></colgroup><tbody>
</tbody>

2. Select the entire area and name the selection RCtable.

RegionJanFebMar
East259744
West122022
North341318
South204751
Total91177125

<colgroup><col width="64" style="width:48pt" span="4"> </colgroup><tbody>
</tbody>

Let A1:D7 house the area for sales by region.

3. In B2 control+shift+enter, copy across to D2, and down:

=SUM(IF(ISNUMBER(MATCH(INDEX(DATA,0,1),IF(INDEX(RCtable,0,1)=$A2,INDEX(RCtable,0,2)),0)),INDEX(DATA,0,MATCH(B$1,INDEX(DATA,1,0),0))))
 
Upvote 0
Hi Aladin Akyurek,

Thanks so much for the quick response. I've followed your instructions - I did remove the space in INDEX(DA TA,1,0),0). Although I get "Not Available" (#N/A) error. I made sure to create the array formula by using the control+shift+enter keys.

What am I doing wrong?

Thanks.
 
Upvote 0
Hi Aladin Akyurek,

Thanks so much for the quick response. I've followed your instructions - I did remove the space in INDEX(DA TA,1,0),0). Although I get "Not Available" (#N/A) error. I made sure to create the array formula by using the control+shift+enter keys.

What am I doing wrong?

Thanks.

That space is due to the board software.

Did you the naming I asked for correctly?

Did you apply control+shift+enter? That is, press down the control and the shift keys at the same time while you hit the enter key?
 
Upvote 0
I finally figured it out. It took me a while as the formula you gave me is a bit beyond my current level of skill (thanks for the development opportunity :)). Turns out the problem was because I created my tables with headers. As a result the "month" wasn't found, hence the #N/A.

Thank you very much for the help!
 
Upvote 0
I finally figured it out. It took me a while as the formula you gave me is a bit beyond my current level of skill (thanks for the development opportunity :)). Turns out the problem was because I created my tables with headers. As a result the "month" wasn't found, hence the #N/A.

Thank you very much for the help!

You are welcome. By the way, the definitions I suggested include the headers.
 
Upvote 0

Forum statistics

Threads
1,215,061
Messages
6,122,921
Members
449,094
Latest member
teemeren

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