Convert excel formula to SQL

Hi, I have an script that need to incorporate this excel formula. Anybody can help me to transform this into SQL code like case statement. thank you in advance.

=IF(O14=0,0,IF(SUM(N14:O14)-(Q14+R14+V14)<0,0,SUM(N14:O14)-(Q14+R14+V14)-X14))

You might want to break this into parts. I might suggest a CTE.

There's no direct equivalent in SQL Server for an Excel range such as "N14:O14". Assuming you can get that value into a column named that, you can do something like this:

CASE WHEN O14 = 0 THEN 0
     WHEN [N14:O14] - (Q14+R14+V14) < 0 THEN 0
     ELSE [N14:O14] - (Q14+R14+V14) - X14
     END

I assume that N14 and others is a column name. Thank you very much Scott.