Formula is giving blank values?

Kaitlyn2004

New Member
Joined
Jun 14, 2014
Messages
1
I'm trying to work on my own investment tracking spreadsheet, and trying to learn from the PortfolioSlicer workbook.

I'm trying to get the "Equity Value" which is this calculated field:
Code:
=ROUND(
   CALCULATE(
		SUMX(tblSymbols
			, tblReport[Qty Held] 
			  * CALCULATE(VALUES(Quotes[Close])
					, LASTNONBLANK(
						DATESBETWEEN(Dates[Date], DateAdd(LastDate(Dates[Date]), -40, day), MAX(Dates[Date]))
					  , CALCULATE(COUNT(Quotes[Close]) )) 


				)
		)
		, LASTDATE(Dates[Date]), All(Dates)
  )
, 2)

However it's just giving blank values. If I change it to this:
Code:
=ROUND(
   CALCULATE(
		SUMX(tblSymbols
			, tblReport[Qty Held] 
			  * 2
		)
		, LASTDATE(Dates[Date]), All(Dates)
  )
, 2)

Then I am in fact getting the Qty Held * 2 showing up.

Anyone have any insights as to why the inner formula is failing/returning blank values? Been pulling my hair out here :(

If I create a 2nd calculated field:
Code:
=LASTNONBLANK(
                        VALUES(Dates[Date])
                      , CALCULATE(COUNT(Quotes[Close])))

I am in fact getting the correct last row/last date I have for that specific symbol
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Code:
CALCULATE(VALUES(Quotes[Close]) 					, LASTNONBLANK( 						DATESBETWEEN(Dates[Date], DateAdd(LastDate(Dates[Date]), -40, day), MAX(Dates[Date])) 					  , CALCULATE(COUNT(Quotes[Close]) ))
When you test this in a separate calculated filed is it returning the desired number?
If not, have you tried messing with the combination of LASTDATE() + MAX() that you have in the DATESBETWEEN()? I know LASTDATE() returns a single column, single row table while MAX() returns a value. Maybe that is causing some issues?

Anyway, if you could post some sample data we may be able to figure something out.</pre>
 
Upvote 0

Forum statistics

Threads
1,226,693
Messages
6,192,465
Members
453,725
Latest member
cvsdatreas

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