Home > Back-end >  Is there any way to convert Excel formula to PostgreSQL formula database?
Is there any way to convert Excel formula to PostgreSQL formula database?

Time:02-23

I have this excel formula which contain values.

H13 = 425, T13 = -17%

Excel Formula

      =IF(H13<>"",IF(H13<0,H13*(1-$T13),H13*(1 $T13)),"")

Output Value after excel calculation is :

       352

I tried with [SQLIZER] https://sqlizer.io/ but not working only provide Insert query.

CodePudding user response:

Here it is in text form:

if H13 is not blank then do:

   IF H13 < 0, calculate H13 * (1 - T13)

   else calculate:  H13 * (1   T13)

else do: blank

CodePudding user response:

You could simplify the formula so it's easier to convert to SQL: H13 (ABS(H13) * $T13)

  • Related