Google-sheets – How to create a formula that will tell me if something is paid, or days overdue

google sheetsworksheet-function

I need a formula for my Google Sheets that marks a cell as PAID once another cell is filled but counts the days overdue if that particular cell ISN'T filled. Currently I'm using:

=IF(DAYS360(M31, TODAY())<1, "Not past due", DAYS360(M31, TODAY()))

but this doesn't account for if the invoice has been paid, which is indicated in cell H31:

Sheets example 1Sheets example 1

I can only seem to get one half of my problem solved. I am looking for a formula that will tell me in N31 if the invoice is paid, and if the invoice isn't paid, how many days it's overdue.

Or maybe I need to rearrange my data to make this possible?

Best Answer

Please try in N2 and copied down to suit:

=if(M2<>"",if(today()>M2,today()-M2,"Not past due"),"")  

You may also want to apply Conditional formatting to any cell with numbers in ColumnN.