# Formula to Search multiple criteria of month/year within a cell and return total numbers from a different cell

##### New Member
Hi All,

I've tried countif using substitute, but I know I'm missing something. I can't figure out how to incorporate counting column B (numbers) if SOME of the text from column A matches column C, provide the total numbers of column B. Ultimately, I would need 8 different text to find. I'm comparing data from September 2016-December 2016 to September 2017-December 2017.

Example:

Col A: week per month, I only care about the month/year - September 2016
September 2016 Week 1
September 2016 Week 2
October 2016 Week 1
October 2016 Week 2

Col B: total projects for that week completed
2
3
4
5

Col C: month/year
September 2016
October 2016
November 2016

So, if the text from col C matches some of the text in Col A, count all the corresponding numbers from Col B and provide the total.

### Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

#### Marcelo Branco

##### MrExcel MVP
Maybe...

 A​ B​ C​ D​ E​ 1​ Week​ Projects​ Keywords​ Result​ 2​ September 2016 Week 1​ 2​ September 2016​ 14​ 3​ September 2016 Week 2​ 3​ October 2016​ 4​ October 2016 Week 1​ 4​ November 2016​ 5​ October 2016 Week 2​ 5​

Formula in E2
=SUMPRODUCT(SUMIF(A2:A5,C2:C4&"*",B2:B5))

Hope this helps

M.

##### New Member
Thank you so much! That formula adds all of the projects, I need count of projects per month from all of the weeks within a month that are listed. So, september 2016 should show 5 projects and October 2016 should show 9 etc. I tried modifying that formula to count "C2" Specific Month(september 2016) to A:A, but the total ends up being "0". Does this formula only work if it's counting all of the cells within a column?

#### Marcelo Branco

##### MrExcel MVP
Ok, this is simpler.
Change the formula in E2 to
=SUMIF(A\$2:A\$5,C2&"*",B\$2:B\$5)
and copy down

M.

Last edited:

Replies
1
Views
78
Replies
14
Views
267
Replies
1
Views
174
Replies
3
Views
285
Replies
2
Views
65

1,127,294
Messages
5,623,829
Members
415,993
Latest member
Nawlins

### 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.

### Which adblocker are you using?

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

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