CVT returns the closest text value (or value with symbol) 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.
CVT(VarNum, MaxDays, StartFlag, Stat_If_Tie, DecPlaces)
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.
||Use the First (earlier) value|
|| Use the Last (later) value |
||Average the two values |
||Use the minimum of the two values |
||Use the maximum of the two values |
DecPlaces: Sets the number of decimal places.
SEE ALSO: CV, DCV
CVT(11,31,1,"First",2) Find the closest text 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.
CVT(11,90,B4,"MAX",2) Find the closest text value to the date in cell B4. If there is a tie, use the Max value. Search up to 90 days.