# Nested IF formula error

**URL:** <https://community.nocodb.com/t/nested-if-formula-error/1593>\
**Category:** Formulas\
**Tags:** data-import-export\
**Created:** [January 13, 2025, 4:05pm UTC](https://community.nocodb.com/t/nested-if-formula-error/1593 "2025-01-13T16:05:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farah](https://avatars.discourse-cdn.com/v4/letter/f/41988e/32.png) [@Farah](https://community.nocodb.com/u/Farah)\
**Post date:** [January 13, 2025, 4:05pm UTC](https://community.nocodb.com/t/nested-if-formula-error/1593/1 "2025-01-13T16:05:10Z")

</div>

I would like to make a formula like this with Nocodb  
IF(Pack=“X”,50,

IF(Pack=“Y”,8,

IF(Pack=“Z”,10,

IF(Pack=“R”,100,

IF(Pack=“F”,22,

IF(Pack=“O”,160,

IF(Pack=“E”,100,

IF(Pack=“D”,1000,

IF(Pack=“T”,99,

IF(Pack=“U”,500,

IF(Pack=“S”,30,

IF(Pack=“F”,30,

IF(Pack=“V”,50,

IF(Pack=“M”,50,

IF(Pack=“Q”,8,

IF(Pack=“P”,45,

IF(Pack=“U”,20,

IF(Pack=“C”,880,

IF(Pack=“L”,45,

IF(Pack=“oo”,88,0

))))))))))))))))))))

---

<div class="post-metadata">

**Author:** ![Navi](https://avatars.discourse-cdn.com/v4/letter/n/3be4f8/32.png) [@Navi](https://community.nocodb.com/u/Navi)\
**Post date:** [January 13, 2025, 5:08pm UTC](https://community.nocodb.com/t/nested-if-formula-error/1593/2 "2025-01-13T17:08:01Z")

</div>

There is an issue with syntax in the formula you have pasted. Easier for this case will be to use Switch in the formula

```auto
SWITCH({Pack}, "X", 50, "Y", 8, "Z", 10, "R", 100, "F", 22, "O", 160, "E", 100, "D", 1000, "T", 99, "U", 500, "S", 30, "V", 50, "M", 50, "Q", 8, "P", 45, "C", 880, "L", 45, "oo", 88, 0)

```
