SUMIFS Month and Year
Hi, I have this formula to sum transactions that match the month - it works well.
=SUMIF({Bank Date}, MONTH(@cell) = 7, {Bank Received Amount}) - SUMIF({Bank Date}, MONTH(@cell) = 7, {Bank Expended Amount})
I want to add a second criterion to match the year as well, I get #INVLAID OPERATIONS.
=SUMIFS({Bank Date}, MONTH(@cell) = 7, YEAR(@cell) = Year@row, {Bank Received Amount}) - SUMIFS({Bank Date}, MONTH(@cell) = 7, YEAR(@cell) = Year@row, {Bank Expended Amount})
Thank you for your help.
Answers
-
Hi @Nancy Skoulphong
Hope you are fine, please try the following formula:
=SUMIFS({Bank Date}, MONTH(@cell) = 7, @cell = Year@row, {Bank Received Amount}) - SUMIFS({Bank Date}, MONTH(@cell) = 7, @cell = Year@row, {Bank Expended Amount})
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
@Bassam Khalil Thank you for your speedy reply. I tried and received the #INVALID OPERATION error.
=SUMIFS({Bank Date}, MONTH(@cell) = 7, @cell = Year@row, {Bank Received Amount}) - SUMIFS({Bank Date}, MONTH(@cell) = 7, @cell = Year@row, {Bank Expended Amount})
-
if you like to fix the formula directly on your sheet please share me as an admin on a copy of your sheets ( Source & Destination ) and i will write the exact formula for you then you can copy it to your original sheet.
My Email: Bassam.k@mobilproject.it
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
It looks like you're searching for two criteria in the same range, the Bank Date column, is that correct? If so, you'll need to list it twice: once for the MONTH, once again for the YEAR.
Try this:
=SUMIFS({Bank Date}, MONTH(@cell) = 7, {Bank Date}, YEAR(@cell) = Year@row, {Bank Received Amount}) - SUMIFS({Bank Date}, MONTH(@cell) = 7, {Bank Date}, YEAR(@cell) = Year@row, {Bank Expended Amount})
You may also be getting errors if the columns have blank data. Try wrapping an IFERROR statement around each MONTh and YEAR function, like so:
=SUMIFS({Bank Date}, IFERROR(MONTH(@cell), 0) = 7, {Bank Date}, IFERROR(YEAR(@cell), 0) = Year@row, {Bank Received Amount}) - SUMIFS({Bank Date}, IFERROR(MONTH(@cell), 0) = 7, {Bank Date}, IFERROR(YEAR(@cell), 0) = Year@row, {Bank Expended Amount})
One final thing to check is all the columns you're referencing. If there's an error in your Bank Date column in the other sheet, this will automatically cause the final formula referencing it to error as well. You'll need to fix the initial source of the error in the referenced column, does that make sense?
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
@Bassam Khalil Thank you. I was able to make it work.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!