Conditional Sum in multi column multi row range

sriche01

Board Regular
Joined
Dec 24, 2013
Messages
136
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I am trying to get the sum within a range based on conditions both vertically and horizontally.


2017201720172017201720172017201820182018201820182018
2 YRAvailableMayJuneJulyAugustFallAprilMayJuneJulyAugustFall
ABC10
54

<tbody>
</tbody>
00000012600360
ABC2042000000810001872
DEF1012601620000540000
GHI11000000180030636000
GHI200000027000000126
GHI30176160000126000900
JKL118126360001440720000108
JKL2014768100009000900000

<tbody>
</tbody>

The above is a sample of data from an availability list.
  • The first column is a set of item numbers.
  • Item numbers consist of several letters (indicates kind) followed by numbers (indicates size)
  • Combinations of kind and size are unique, but any one kind can have 1 or multiple sizes
  • The calendar headings are revolving time frames. "2YR" is static, "Available" is always the current month or time frame, and they are consecutive after that.
  • There is a hidden column between each of the columns above that I do not want to sum. It does not have a year heading.

On another sheet, I have a list of Item prefixes (e.g. ABC, DEF, GHI etc.). These indicate kind regardless of size.

Bottom line
I want to sum the numbers available for each Item prefix (all sizes - so totaling all ABC1 and ABC2 on the ABC line) when the year is the current year. So I need a formula to sum the rows that start with the right prefix, but only the columns that say 2017. Keep in mind those columns change. When we get to May, the number of columns headed with 2017 reduces by 1 and those headed with 2018 increases by 1. However, they stay in chronological order. Any Ideas? Thank you in advance!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(SEARCH(X2&"|",$A$3:$A$10&"|")),IF($B$1:$N$1=Y$1,$B$3:$N$10)))

where X2 = ABC and Y1 = 2017.
 
Upvote 0
Thank you! Worked with the exception of the first &"|". Changed to "*" and worked great. Thank you again!
 
Upvote 0

Forum statistics

Threads
1,215,205
Messages
6,123,634
Members
449,109
Latest member
Sebas8956

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