If, then formula help

I need to replace the first 4 characters in a text string if the range has any of the criteria.
="0000" + "-" + [Function Code]@row + "-" + [Dept Code]@row + "-" + [Object Code]@row + "-" + SubObject
above is my current formula and an example of the output code is: 0000-10-3459-4500-4502
so...
0000" if column SP Code and Column AG Code are both blank but Dept Code is not blank
"0010" if column SP Code is not blank but AG Code and Dept Code are blank
"0080" if column AG Code is not blank but SP & Dept Codes are blank
Answers
-
Substitute may help you here.
School of Sheets (Smartsheet Partner)
If my answer helped please accept and react w/π‘Insightful, β¬οΈ Vote Up, β€οΈAwesome!
-
thank you!
-
=IF(AND(ISBLANK(SP@row), ISBLANK(AG@row), NOT(ISBLANK(Dept@row))), "0000",
IF(AND(ISBLANK(AG@row), ISBLANK(Dept@row), NOT(ISBLANK(SP@row))), "0010",
"0080"))
...
Help Article Resources
Categories
Check out the Formula Handbook template!