# Nested conditional on formula

**URL:** <https://community.fibery.io/t/nested-conditional-on-formula/878>\
**Category:** Get Help\
**Created:** [August 3, 2020, 7:40am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878 "2020-08-03T07:40:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haslien](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/haslien/32/493_2.png) [@Haslien](https://community.fibery.io/u/Haslien)\
**Post date:** [August 3, 2020, 7:40am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/1 "2020-08-03T07:40:52Z")

</div>

Is it possible to have nested or multiple possible outputs in formulas in some way?

I want to create an indicator if a task was created over 30 days ago and does not have a “Final” checked state, by setting a text field to an emote.

Additionally, I want to have a _different_ symbol, or both if possible, if it has due date and it is in less than 7 days.

Right now they’re only one and the same through an `or` in the condition. It will display icon if either is true, and nothing if it doesn’t have due date or conditions are not met.

```auto
If(
	(
		(ToDays(Today() - [Creation Date]) > 30)
		and
		(State.Final = false)
	) or (
		(ToDays([Due date] - Today()) > 0)
		and
		(ToDays([Due date] - Today()) < 7)
		and
		(State.Final = false)
	),
	"⚠",
	""
)

```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 3, 2020, 12:08pm UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/2 "2020-08-03T12:08:23Z")

</div>

I imagine it will be fairly easy to achieve if/when string concatenation becomes available in the formula field, but for the time being it’s certainly possible to nest ‘if’ functions:  
If(Cond1,“A”,If(Cond2,“B”,“C”))  
Using that method, you could write conditional logic to achieve what you’re describing (as far as I understand you).

---

<div class="post-metadata">

**Author:** ![B\_Sp](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@B\_Sp](https://community.fibery.io/u/B_Sp)\
**Post date:** [August 5, 2020, 2:32am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/3 "2020-08-05T02:32:48Z")

</div>

Concatenation is a great type of formula. Things like a Contact, where you could have one field for “Full Name,” and that would generate based on two other fields: “First Name” and “Last Name”

Great Suggestion!

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [August 7, 2020, 8:46am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/4 "2020-08-07T08:46:58Z")

</div>

Hi, Martin!

Here is how your formula will look like 🙂

```
If(
    (((ToDays(Today() - [Creation Date]) > 30) and (State.Final = false)) and (ToDays([Due date] - Today()) > 0)) and (ToDays([Due date] - Today()) < 7),
    "💩🚨",
    If((ToDays(Today() - [Creation Date]) > 30) and (State.Final = false),
        "💩",
        If(((ToDays([Due date] - Today()) > 0) and (ToDays([Due date] - Today()) < 7)) and (State.Final = false),
           "🚨",
           "🤗"
         )
    )
)
```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [August 24, 2020, 11:55am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/5 "2020-08-24T11:55:41Z")

</div>

It’s now a whole lot easier thanks to concatenation in formulas 🙂

> [@CHANGELOG: August 24 / Text formulas, Undo in Table View](https://community.fibery.io/t/changelog-august-24-text-formulas-undo-in-table-view/908):
>
> The last two weeks were [challenging in Belarus](https://en.wikipedia.org/wiki/2020_Belarusian_protests). We slowly got back to work and released a new build with some long-awaiting features. Sorry for delays, we’re doing our best under current circumstances. fallen_leaf Text Formulas Finally you can use text in formulas. For example, create a composite text field: Name + " " + [Public Id] or create a clever URL fields: "https://www.google.com/maps/search/?api=1&query=" + Address Here is the full list of text functions Length(text) Calculat…

If( (ToDays(Today() - [Creation Date]) \> 30) and (State.Final = false) ),“🎈”,“”) + if ( (ToDays([Due date] - Today()) \> 0) and (ToDays([Due date] - Today()) \< 7) ),“⚽”,“”)

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [August 25, 2020, 8:40am UTC](https://community.fibery.io/t/nested-conditional-on-formula/878/6 "2020-08-25T08:40:06Z")

</div>

Definitely!  
Also glad it is here 🧐✨
