# SUMIF Prior 3 months

#### Geo1126

##### New Member
Greetings Excel Wizards.

I'm trying to figure out how to make a SUMIF formula work based on the prior 3 months of the current month (excluding the current month). I have hundreds of parts with hundreds of shipments on my source data sheet (a shipping log). on a separate table I have a single line per part that totals my various data. I want to be add a data collect for those prior 3 months and have been stumped on how to do it.

I'm maybe a set up from complete novice with excel, and everything I've learned thus far has been self taught. Can't get this one going. I apologize if this has already been covered, i did spend a little time searching for the answer.

here is a very basic example. This assumes the current date is in April. Thus it excludes the April and December dates from desired results. Only want Prior 3 months, Jan/Feb/Mar. I hope this makes sense, and I truly appreciate any help on this. lets say Part Number is column A, Date is B and QTY is C

 SOURCE DATA Part # Date Shipped QTY 1 12/20/2018 2,658 1 12/21/2018 3,697 1 12/29/2018 1,000 2 1/1/2019 1,254 2 1/1/2019 1,234 2 1/2/2019 1,254 3 1/2/2019 1,698 3 1/5/2019 542 3 1/10/2019 429 2 2/10/2019 4,258 1 2/10/2019 251 1 2/10/2019 3,269 1 2/11/2019 258 2 2/12/2019 654 2 2/12/2019 111 3 2/12/2019 12,569 1 2/15/2019 3,254 2 2/15/2019 7,826 3 2/15/2019 2,596 4 2/15/2019 4,245 1 3/1/2019 4,269 2 3/1/2019 3,249 1 3/1/2019 9,215 2 3/1/2019 2,150 3 3/1/2019 2,301 4 3/1/2019 6,580 3 3/15/2019 3,291 3 3/15/2019 1,928 2 3/15/2019 2,397 2 3/15/2019 4,528 2 4/10/2019 2,015 1 4/10/2019 1,025

<tbody>
</tbody>

DESIRED RESULTS
 Part Total shipped Prior 3 months 1 28,896 20,516 2 30,930 28,915 3 25,354 25,354 4 10,825 10,825

<tbody>
</tbody>

### Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Last edited:

Fluff,

You are my hero.

Thank you!

#### FormR

##### MrExcel MVP
I'm trying to figure out how to make a SUMIF formula work based on the prior 3 months
Hi, here is an alternative option that uses SUMIFS()

#### Fluff

##### MrExcel MVP, Moderator
Fluff,

You are my hero.

Thank you!
You're welcome & thanks for the feedback

#### Geo1126

##### New Member
Hi, here is an alternative option that uses SUMIFS()

Worksheet Formulas
CellFormula
F2=SUMIFS(C:C,A:A,E2)
G2=SUMIFS(C:C,A:A,E2,B:B,">="&EOMONTH(TODAY(),-4)+1,B:B,"<="&EOMONTH(TODAY(),-1))

<tbody>
</tbody>

<tbody>
</tbody>
oh man... i was soooo close to this one. Thank you also FormR! you are a rockstar!