Google-sheets – How to compare the values of two columns and return the result in new columns

google sheetsgoogle-apps-script

EX. https://docs.google.com/spreadsheets/d/1CwFXSwIgnPdMocbrhTFZbEPRyXZUiovvWNy9MtOagxE/edit#gid=0

I wanted to compare two column "fix version" and "Affected version" and return the result bases on below logic.

if the fix version tag = affected version → pre-release

if the fix release tag > affected version → post-release

I am new to Google Script, so how can I do that using Google Script?

Best Answer

Why not using simple formula? Thy this formula, paste it in any free cell (row2):

=ARRAYFORMULA(if(A2:A=C2:C,"pre-release",if(C2:C>A2:A,"post-release","other")))