I want to create a new column from data in an existing column. I need to find the file extension in the existing column then put text into a new column based on the extension. See below:
ExistingCol
filename.ai
filename.png
filename.docx
filename.pptx
NewCol
Adobe Illustrator
Image
Word Doc
Powerpoint
I am using the Formula tool to create a new column and have written an IF statement to test if I can do this and am getting a parse error and I'm not sure why.
IF contains([FileName],".ai") then
"Adobe Illustrator"
ENDIF
Why isn't this working?
Solved! Go to Solution.
Hi @workgirl
The reason would the IF block goes like
IF (condition) Then action
Else action EndIF
You are missing the Else Part
Hi @workgirl
Here is a formula for the task.
IF contains([FileName],".ai") THEN "Adobe Illustrator"
ELSEIF contains([FileName],".png") THEN "Image"
ELSEIF contains([FileName],".docx") THEN "Word Doc"
ELSEIF contains([FileName],".pptx") THEN "Powerpoint"
ELSE Null() ENDIF
Output:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Thanks. Added the balance and it works great.