Formula not calculating if blank cells

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Hello peeps,

I am at an impasse with this and am hoping someone can help.

I have a formula that is based on multiple cells. This is working if there is a value in every relevant cell. However, I need it to work even if there are blanks. I have replicated in a test and this is working fine - just not the formula in the main area of the worksheet.

It would be too lengthy to list the issue details here (and besides, on paper, it works!), so, I have attached a link to the actual spreadsheet.

EA Placements Manager

The problem is on worksheet 'EA Placements' and the column in which the formula is not behaving is GY (from row 8). I have laid out a test on columns GX - HK, row 1.

Fresh eyes and any help would be very much appreciated :)
 
p.s. and so why does the subsidy formula work (cell HX8), which is based on the same principles?!? :unsure:
 
Upvote 0
For HV8 use
Excel Formula:
=LET(f,WRAPROWS(FILTER(AE8:CN8,($AE$6:$CN$6="weekly true cost")+($AE$6:$CN$6="No. of nights in fiscal year")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1)/7,TAKE(ff,,-1)))
and for HW8 use
Excel Formula:
=LET(f,WRAPROWS(FILTER(DC8:FE8,($DC$6:$FE$6="HB Amount Awarded")+($DC$6:$FE$6="No. of nights in fiscal year")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1)/7,TAKE(ff,,-1)))

The other option is to use your existing formulae, but change the formulae in AH, AK AS, AV etc to return 0 rather than "" as that is what is causing the problem.
 
Upvote 0
Wow. Just wow! I really do appreciate the explanations too - thank you, @Fluff. Always learning thanks to the masters like you :cool:

Very last thing, I have tried to amend to calculate from a cell that has a nightly figure, so don't need the divide by 7 (formula in HZ8). So, I just need the first column to multiply by the second column. I tried tweaking as below, but it is calculating incorrectly (it is returning a figure but the wrong one).

VBA Code:
=LET(f,WRAPROWS(FILTER(AC8:CO8,($AC$6:$CO$6="Nightly Cost")+($AC$6:$CO$6="No. of nights in fiscal year")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1),TAKE(ff,,-1)))

EA Placements Manager
 
Upvote 0
Your Nightly Cost headings have a line feed rather than a space, try
Excel Formula:
=LET(f,WRAPROWS(FILTER(AC8:CO8,($AC$6:$CO$6="Nightly"&CHAR(10)&"Cost")+($AC$6:$CO$6="No. of nights in fiscal year")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1),TAKE(ff,,-1)))
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
I offer deepest, sincerest thanks, @Fluff. This thread has truly blown my mind and enhances my learning via the Greats such as you! That's a bit gushy for a Thursday evening, but heartfelt! :giggle:
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
Hi there,

I just need to tweak one of these formulas and am getting into a muddle.

The existing formula, which works by multiplying a nightly amount by the number of fiscal nights is:
Excel Formula:
=LET(f,WRAPROWS(FILTER(AG8:DR8,($AG$6:$DR$6="Nightly Contribution")+($AG$6:$DR$6="No. of fiscal year nights")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1),TAKE(ff,,-1)))

However, a total amount will now be entered, rather than a nightly one, so I need this total figure divided by the "Number of Nights" and then multiplied by the "No. of fiscal year nights". I have tried, among others and without success:
Excel Formula:
=LET(f,WRAPROWS(FILTER(AG8:DR8,($AG$6:$DR$6="Final Contribution")/($AG$6:$DR$6="Number of Nights")*($AG$6:$DR$6="No. of fiscal year nights")),2),ff,IF(f="",0,f),SUMPRODUCT(TAKE(ff,,1),TAKE(ff,,-1)))

Any advice would be appreciated :)
 
Upvote 0
Can you post some sample data.
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,963
Members
449,480
Latest member
yesitisasport

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