Hello everyone. I am having an issue where I do not see a way to make any of my formulas iterate any specified number of times, let's say similarly to a "for" loop in a programming language. I am curious if there is a solution I am overlooking or if this is not currently doable with Smartsheet. Please see my example below, which uses for loop syntax from C++ as a way of summarizing what I am trying to achieve:
FORMULA = X
for(# =1; # <= 35; #++) {
X = X + IF(CONTAINS("NO", [Q#]@row), UNICHAR(10) + UNICHAR(10) + ">>> FINDING " + COUNTIF([Q1]@row:[Q#]@row, CONTAINS("NO", @cell)) + " OF " + [TOTAL NUMBER OF FINDINGS]@row + " <<<" + UNICHAR(10) + UNICHAR(10) + "QUESTION: Q#" + UNICHAR(10) + "QUESTION TEXT: \"" + INDEX({Question Text}, #) + "\"" + UNICHAR(10) + "FINDING: " + INDEX({Reason Names}, VALUE(LEFT(RIGHT([Q#]@row, 3), 2))) + UNICHAR(10) + "OPERATOR NAME: " + [Q# Operator Name]@row + UNICHAR(10) + "DEFECT ORIGIN: " + [Q# Defect Origin]@row + UNICHAR(10) + "COMMENTS: " + [Q# Comments]@row, "")
}
I am writing a formula to do the operation contained in the loop above for 35 question responses received from a form. The only solution I can see right now is to manually paste the part in the loop for every single # from 1 through 35. Note: This creates a HUGE formula which actually cannot even fit in a single cell, which I solve by using several intermediate steps across several columns in order to reach the same result as having the whole formula in one cell.
Does anyone have a solution to problems like these? If so, this would be a HUGE help!
Thank you!!!