Home : CV
Q14469 - INFO: CV
CV returns the closest value found for the variable and date/time specified. Searches forward and backward and uses the value whose datestamp that is closest to the time being calculated.  If there is a tie (e.g. there is a value yesterday and a value tomorrow) it will then use the Stat_If_Tie to calculate the value. 


CV(VarNum, MaxDays, StartFlag, Stat_If_Tie)

VarNum:  The variable number to search for.  Can be a number (i.e. 12) or a cell reference (i.e. C2).

MaxDays:  Sets maximum number of days to search before giving up.

StartFlag: Sets when the seach begins.  Has the following settings:

1 - Start searching on the start date
2 - Start searching on the end date
3 - Start searching one day before start date
4 - Start searching one day after the end date
11 - Start searching at the 11:59:59 PM of the Start Date.
12 - Start searching at the 11:59:59 PM of the End Date.
13 - Start searching at the 11:59:59 PM of one day before start date
14 - Start searching at the 11:59:59 PM of one day after the End Date.
“Date/Time” - A date/time in quotes to start the search on. 

Stat_If_Tie: A quoted string that specifies what to calculate when the 2 values are the same time difference from the slot being calculated. 

Stat Description
First Use the First (earlier) value
Last  Use the Last (later) value
Avg Average the two values
Min Use the minimum of the two values
Max Use the maximum of the two values



CV(11,31,1,"First")  Find the closest value to the start date of the report (StartFlag = 1).  If there is a tie, use the first (earlier) value. Search up to 31 days.

CV(11,90,B4,"MAX") Find the closest value to the date in cell B4.  If there is a tie, use the Max value. Search up to 90 days.

Daily Variable V10001 Examples:


CV Daily Detail (hourly variable) examples:


Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?


Tell us why you rated the content this way. (optional)
Approved Comments...
No user comments available for this article.
Created on 9/6/2017 11:22 AM.
Last Modified on 9/6/2017 1:06 PM.
Last Modified by Scott Dorner.
Article has been viewed 1653 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article