Dynamic sum imbedded in a vlookup

casco

New Member
Joined
Sep 21, 2020
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi all I'm in need of some advise in regards to a dynamic sum imbedded in a VLOOKUP.

I'm working on a spread sheet that will need to pick up values, using a VLOOKUP, in a second tab, which is easy enough, however my problem arises when I get to the requirements of summing the year to date. So the first VLOOKUP for a given month is working, but when I get to the second month or more of the financial year I will need to sum up all the previous month. ie Jan + Feb when reporting on Feb and Jan, Feb and Mar when reporting on March and so on.

A sample table is below


ABCDEFGHIJ
1Jan
FebMarAprMayJunJulAug
2Sales10000030000020000050000750002000005000020000
3

Formula should pick up the sales values of a given month based on a drop down, for example Mar, but it should then sum the month from March and back to Jan - in this example it should return 600000.

to pick up the correct month I'm using the following formula =VLOOKUP (criteria, range in tap, Match(month drop down, range ,0),0). Using the table above it would be =VLOOKUP ( sales , A:I , Match ( Mar , A:I , 0), 0)

The problem comes when I need to sum the month from march and back to Jan, in the same VLOOKUP formula. obviously this will also have to work when the Match is looking for Aug.

Any input will be appreciated.

I'm using Office 2010

Best
Martin
 

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.
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMN
1JanFebMarAprMayJunJulAug
2Sales10000030000020000050000750002000005000020000Mar600000
3
Master
Cell Formulas
RangeFormula
N2N2=SUM(B2:INDEX(B2:I2,MATCH(M2,B1:I1,0)))
 
Upvote 0
=SUM(B2:INDEX(B2:I2,MATCH(M2,B1:I1,0)))
HI Thanks for the reply. The formula works on it's own and with the dropdown, but when include in the VLOOKUP I described the whole formula returns a #REF! error unfortunately. Is this because the Col_Index_num in the VLOOKUP formula cant handle the sum formula?

I have gone through the VLOOKUP formula in detail and cant see any errors in it.

Any suggestions?

Best

Martin
 
Upvote 0
Why are you including it in a vlookup? Just use the formula as-is
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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