# Need help creating nested IF and LEFT formula in a calculated column

I have the following data in a text column called [Workcenter]

``````1 SOCS

CSS

SCXP

SCQA

SCOO

SCPR
``````

I need a formula which will create the following results

``````CC

CC

SCX

SCQ

SCO

SCP
``````

I'm trying to combine these 2 working formulas

``````=IF([Workcenter]="1 SOCS","CC",IF([Workcenter]="CSS","CC"))

=LEFT([Workcenter],LEN([Workcenter])-1)
``````

I tried this formula without success

``````=IF(Workcenter="1 SOCS","CC",IF(Workcenter="CSS","CC"(=LEFT([Workcenter],LEN([Workcenter])-1))))
``````

Any ideas?

Equals ("=") just means a formula follows. You one need one per formula. Try removing the extra equal sign in front of the LEFT.

``````=IF(Workcenter="1 SOCS","CC",IF(Workcenter="CSS","CC", (LEFT([Workcenter],LEN([Workcenter])-1))))
``````

A more neatly formatted version:

``````=IF(
Workcenter="1 SOCS","CC",
IF(
Workcenter="CSS","CC",
LEFT([Workcenter],LEN([Workcenter])-1)
)
)
``````
• I tried your suggestion. I also tried, no luck: =IF(Workcenter="1 SOCS","CC",IF(Workcenter="CSS","CC"(LEFT(Workcenter,LEN(Workcenter)-1))))
– Joe
Commented Sep 21, 2018 at 18:11
• What was the error? Would it save the formula, but display the correct results. (I'll go and create a test list...) Commented Sep 21, 2018 at 18:18
• You were missing a comma, just before "(LEFT". I fixed in the answer above. Commented Sep 21, 2018 at 18:23

Thanks for the help Mike! This is what I have working:

=IF(OR([Workcenter]="1 SOCS",[Workcenter]="CSS"),"CC",LEFT([Workcenter],LEN([Workcenter])-1))