Forum Discussion
Subtract columns based on condition
Hello!
I've table with payments info. I want that field in "PaidIn" column would be empty if "PaymentDate" is empty.
I use below formula to calculate PaidIn:
PaidIn = [PaymentDate]-[InvoiceDate].
I try to use formula: PaidIn = IF(ISBLANK([PaymentDate]);"";[PaymentDate]-[InvoiceDate]) but it is not working.
Please share your thoughts how this can be solved.
Thanks!
- Anonymous8 years ago
First make sure that the Format of your columns is in Date.
Then use this formula for your calculated column:
PaidIn = IF(NOT ISBLANK(Test[Payment Date]), DATEDIFF(Test[Invoice Date],Test[Payment Date],DAY))
My table's name is "Test" which explains the word Test in the formula above.
Hope this helps!
3 Replies
- AnonymousNot applicable
First make sure that the Format of your columns is in Date.
Then use this formula for your calculated column:
PaidIn = IF(NOT ISBLANK(Test[Payment Date]), DATEDIFF(Test[Invoice Date],Test[Payment Date],DAY))
My table's name is "Test" which explains the word Test in the formula above.
Hope this helps!
- AnonymousNot applicable
Thank you, Anonymous!
- AnonymousNot applicable
You're welcome. Happy to help!