Forum Discussion

JetJungle's avatar
JetJungle
Copper Contributor
Dec 12, 2018
Solved

Create text string from input

Is there a formula that creates a text string as shown below from the following inputs: Period Start 4 Period End 6 Factor 0.5 Text string 4|0.5;5|0.5;6|0.5 The text string is in a format th...
  • JWR1138's avatar
    JWR1138
    Dec 12, 2018

    Are you familiar with User Defined Functions? I believe the function below would do what you are after. 

     

    Function PeriodString(PeriodStart As Integer, PeriodEnd As Integer, Factor As String)

     

    Dim i As Integer

     

    For i = PeriodStart To PeriodEnd

     

    If i = PeriodEnd Then
    PeriodString = PeriodString & i & "|" & Factor
    Else

    PeriodString = PeriodString & i & "|" & Factor & ";"

    End If

     

    Next i

     

    End Function

Resources