Introduction
When I was creating an Ageing Schedule for my Debtors (Receivables), I created a summary at the bottom in which I wanted to summarise the various conditions in the table such as
What is the value of all invoices
- Paid
- Current
- Overdue
I used the SUMIF() and SUMIFS() functions for this but SUMIFS() can only tell me AND conditions and not OR conditions ... read on!
Ageing Schedule
Here is the example ageing schedule I was working on:
Here is the summary I created at the bottom of that schedule:
Combine SUM() and SUMIFS()
Database Functions
I know a lot of people either don't like database functions or they have never heard of them but I also demonstrated their use in this example, as follows:
These functions work like a charm and they cope with AND/OR with consummate ease!
By the way, I had a thought as I was putting these DSUM() functions together: rather than setting up the helper tables that you see in C36:D38 and C40:D41, can we use the database itself for this?
Well, look at the formula in cell E42 which shows the answer to that is Yes, we can! ...
I always say that the Database functions are so clean and tidy when compared to SUMIFS() and SUMPRODUCT() but when allied to an Excel table, that doesn't look to be true, does it? Try this, though:
=DSUM(A13:F28,E13,E13:F28)
There, that's tidy!
Conclusions
That's another arrow to your both: wrapping SUM() round the SUMIFS() function to find OR conditions rather than just AND conditions. You also saw from me, again, how simple and valuable and versatile the Database functions can be.
Duncan Williamson
12 October 2022
No comments:
Post a Comment