Help with 'Sumifs' formula, where I want it to pick up if a cell contains a month (one criteria) and a - figure (in the second criteria)

Samsung88

New Member
Joined
Jan 2, 2015
Messages
6
Hi All!

I am new to this forum and I am also rather new at Excel!

I am trying to use a formula that will calculate the below:
If in column A, a date in December appears, tell me the total amount of column C, if the amount is greater than 0

This should then calculate the total expense for December. I then need to calculate the total 'Paid in' - where I would use the same formula, but change the last criteria to IF the amount is less than zero

The table below is the area where my formula will be, and I will be doing this for all months (This formula obviously makes no sense and would not work in excel, but this is just to show the kind of track that I was on)

Any help at all would be greatly appreciated! Thank you all in advance

DateDetail Amount
01-DecBalance brought forward £ 1,417.00
06-DecCouncil Tax £ 47.50
08-DecDirect Debit £ 62.00
09-DecWater £ 12.82
12-DecElectricity £ 13.50
28-DecGas £ 15.00
01-JanTrip £ 250.00
10-DecPayment-£ 944.67
11-JanEssential expense £ 10.00

<tbody>
</tbody>
Paid inBalance
=sumsifs(A2:A9="*Dec*", "Dec","",C2:C9>0)=sumsifs(A2:A9="*Dec*", "Dec","",C2:C9<0)

<tbody>
</tbody>
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the board...
How's your date column formatted?
And where do you want the results?
Will you have a different sheet for each month?
 
Last edited:
Upvote 0
Hi Both!

Thank you for responding so quickly,

Caribeiro77
- the date is formatted as "custom" at the minute.
- the answer will be in cell G2 for the balance, and H3 for Paid in
- I was hoping to continue the same table throughout 2015 for all months, and simply adjust the formula in columns G and H, to reflect this

Aladin Akyurek
- December is 2014, where as January is 2015



 
Upvote 0
Date
Detail
Amount
1-Dec-14
Balance brought forward
1,417.00
6-Dec-14
Council Tax
47.5
8-Dec-14
Direct Debit
62
9-Dec-14
Water
12.82
12-Dec-14
Electricity
13.5
28-Dec-14
Gas
15
1-Jan-15
Trip
250
10-Dec-14
Payment
-944.67
11-Jan-15
Essential expense
10
Month/Year
Paid in
Balance
1-Dec-14
1567.82
-944.67

<TBODY>
</TBODY>

B12:
Rich (BB code):
=SUMIFS(
  $C$2:$C$10,
  $C$2:$C$10,">0",
  $A$2:$A$10,">="&A12,
  $A$2:$A$10,"<="&EOMONTH(A12,0))

C12:
Rich (BB code):
=SUMIFS(
  $C$2:$C$10,
  $C$2:$C$10,"<0",
  $A$2:$A$10,">="&A12,
  $A$2:$A$10,"<="&EOMONTH(A12,0))
 
Upvote 0
How about:
=SUMPRODUCT(($C$2:$C$10>0)*(MONTH($A$2:$A$10)=12)*($C$2:$C$10))
=SUMPRODUCT(($C$2:$C$10<0)*(MONTH($A$2:$A$10)=12)*($C$2:$C$10))

Extra criteria, i.e.:
=SUMPRODUCT(($C$2:$C$10>0)*(MONTH($A$2:$A$10)=12)*(B2:B10="water")*($C$2:$C$10))
 
Upvote 0
Hi Aladin,

Thank you for the formula there, I have tried it and it worked. I could follow/understand the formula up until the third section, I couldnt figure out what this part was telling Excel to do- though it is obviously very important! Would you be so kind as to explain the below to me, please?


$A$2:$A$10,"<="&EOMONTH(A12,0)</pre>
I like to understand how formulas work, so I can use them again more easily in the future!

Lexcerm
Thank you for your suggestion, I have never used sumproduct before, but I am going to have a play around with the formula now, and see how it works and figure out the best option!
Thanks again
 
Upvote 0
Hi Aladin,

Thank you for the formula there, I have tried it and it worked. I could follow/understand the formula up until the third section, I couldnt figure out what this part was telling Excel to do- though it is obviously very important! Would you be so kind as to explain the below to me, please?


$A$2:$A$10,"<="&EOMONTH(A12,0)

</PRE>
I like to understand how formulas work, so I can use them again more easily in the future!

EOMONTH delivers the last day of the month of a given date. When A12 = 1-Dec-14,
EOMONTH will calculate 31-Dec-14.

Lexcerm
Thank you for your suggestion, I have never used sumproduct before, but I am going to have a play around with the formula now, and see how it works and figure out the best option!
Thanks again
[/quote]

SUMIFS is faster than SUMPRODUCT. Moreover, it must be extended with a year test.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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