Formula help

sachavez

Active Member
Joined
May 22, 2009
Messages
469
I'm using the following formula to look up and sum cost information for Brakes and Air System:

=SUMPRODUCT(($B$63:$B$102="Brakes & Air System")*($C$63:$N$102))

The formula works well, but I am charting year / year comparison and need to modify the formula to sum Jan through whatever month is listed in cell $C$2.

My month header row is 62.

My thought is that if I change cell $C$2 to Feb, the forumla will only sum the numbers listed in Jan & Feb for Brakes & Air System.

Thanks in advance.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Assuming you dates are in Col C as true dates rather than text: Input the month in C2 as a date formated as "mmm" rather than text. Then try:

Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($C$63:$N$102)=$C$2))
 
Upvote 0
assuming dates in column A maybe

=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--($C$63:$N$102),--(MONTH(A63:A102)<=2))
 
Upvote 0
Assuming you dates are in Col C as true dates rather than text: Input the month in C2 as a date formated as "mmm" rather than text. Then try:

Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($C$63:$N$102)=$C$2))


My months are entered in as general (no specific format).
 
Upvote 0
Here's how the data is set up. The add-in only pulled in 2011 data; my 2010 data set is in range $C$63:$C:$102.



Excel Workbook
ABCDEFGHIJKLMN
10YearAir BrakesChassisDoorsICC BumpersLanding LegsNoseReeferRoofSideTires
112011$7,330$7,123$3,091$706$4,932$2,229$2,286$10,354$12,008$29,327
122010$41,453$43,197$17,473$5,621$36,315$10,423$23,456$35,063$68,136$190,437
13Change$34,122$36,073$14,381$4,915$31,384$8,194$21,171$24,709$56,128$161,110
14% Change465.5%506.4%465.2%696.5%636.4%367.6%926.2%238.6%467.4%549.4%
15% of total8.8%9.2%3.7%1.2%7.7%2.2%5.0%7.4%14.4%40.4%
16$6,2262011 MTD Tires only
172011 Data$33,2722010 MTD Tires only
18SourceCategoryJanFebMarAprMayJunJulAugSepOctNovDec
19JBHBRAKES & AIR SYSTEM$138
20JBHCHASSIS UNIQUE ITEMS$1,050$1,262
21JBHCLEANING
22JBHCONTAINER UNIQUE ITEMS$147
23JBHDECALS, MARKINGS, LOGOS
24JBHDOORS & HARDWARE
25JBHELECTRICAL, LIGHTS, REFLECTIVE TAPE$27
26JBHGRID SECTION & CROSSMEMBERS
27JBHICC BUMPER AREA$470
28JBHINTERIOR
29JBHLANDING LEGS$901$33
30JBHMISC
31JBHNOSE$636$1,020
32JBHREFR
33JBHROOF$451$2,566
34JBHSIDE$719$6,667
35JBHTANDEM
36JBHTAX CODES
37JBHTIRES & RIMS$3,113$3,113
Alliance
 
Upvote 0
this should work then (if your dates are in Column C):


Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($C$63:$N$102)<=Month($C$2)))
if your dates are for instance in Col A try:

Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($A$63:$A$102)<=Month($C$2)),($C$63:$N$102))
If your months are in the header Row 62 col C-N offhand I don't see a way this is going to fly.

EDIT: Crossed with your post of data layout. The headers in Rows 18 / 62 are entered as text I presume?
 
Last edited:
Upvote 0
Correct: EDIT: Crossed with your post of data layout. The headers in Rows 18 / 62 are entered as text I presume?

this should work then (if your dates are in Column C):


Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($C$63:$N$102)<=Month($C$2)))
if your dates are for instance in Col A try:

Code:
=SUMPRODUCT(--($B$63:$B$102="Brakes & Air System"),--(Month($A$63:$A$102)<=Month($C$2)),($C$63:$N$102))
If your months are in the header Row 62 col C-N offhand I don't see a way this is going to fly.

EDIT: Crossed with your post of data layout. The headers in Rows 18 / 62 are entered as text I presume?
 
Upvote 0
Try:

Excel Workbook
BCDE
2Feb
3air brakes
420104
520118
6
7
8
9
10janfebmar
11air brakes11
12xxx11
13air brakes11
14
15janfebmar
16air brakes222
17xxx222
18air brakes222
Tabelle1
Cell Formulas
RangeFormula
D4=SUMPRODUCT(--(($B$11:$B$13)=$D$3)*(INDIRECT("R11C3:R13C"&2+MONTH($C$2),FALSE)))
D5=SUMPRODUCT(--(($B$16:$B$18)=$D$3)*(INDIRECT("R16C3:R18C"&2+MONTH($C$2),FALSE)))

Adjust ranges to your ranges 19 - 58, 63 - 102

C2 has a real date (01.02.2010) formatted as "MMM"
 
Upvote 0
This looks like it will work!

Thank you very much for your time and effort. I truly appreciate it!
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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