Leave the cell blank if no data from the forumula

Leannee

New Member
Joined
Jun 27, 2018
Messages
3
I am making a spreadsheet to organise when rent is paid. Because the rent is paid on different days and figures in the month I created the formula to show the total they have paid each month.

=SUMPRODUCT((MONTH(D8:D250)=1)*(YEAR(D8:D250)=2018)*(E8:E250))


At the moment if nothing is written in the cells, e.g for July, this is showing as £0. I am trying to add to this formula so that the cell remains blank.

I have used the conditional formatting to make the writing clear however I want a running balance of what they owe so this isnt any good.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
=IF(=SUMPRODUCT((MONTH(D8:D250)=1)*(YEAR(D8:D250)=2018)*(E8:E250))
=0,"",=SUMPRODUCT((MONTH(D8:D250)=1)*(YEAR(D8:D250)=2018)*(E8:E250))
)

You could shorten that to

=IF(SUMPRODUCT((TEXT(D8:D250,"yyyymm")="201801")*(E8:E250))=0,"",SUMPRODUCT((TEXT(D8:D250,"yyyymm"))="201801")*(E8:E250))
 
Upvote 0
This doesn't work. Its showing as 'Value'.

I even thought of changing the dates to mmyyyy but this shows as blank even when the price is there. Any ideas?
 
Upvote 0
This doesn't work. Its showing as 'Value'.

I even thought of changing the dates to mmyyyy but this shows as blank even when the price is there. Any ideas?

You have text in D8:D250 or E8:E250.
For SUMPRODUCT to work the data in the ranges specified must all be numbers.

Try deleting any spaces that are in the ranges first.
 
Upvote 0
There's an error in the first formula (it had equal signs before the SUMPRODUCT) it should be

=IF(SUMPRODUCT((MONTH(D8:D250)=1)*(YEAR(D8:D250)=2018)*(E8:E250))=0,"",SUMPRODUCT((MONTH(D8:D250)=1)*(YEAR(D8:D250)=2018)*(E8:E250)))

second formula should be (brackets in wrong position)

=IF(SUMPRODUCT((TEXT(D8:D250,"yyyymm")="201801")*(E8:E250))=0,"",SUMPRODUCT((TEXT(D8:D250,"yyyymm")="201801")*(E8:E250)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

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