<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> This example database is a simple habit tracker. Each property represents a different habit, and the Habits formula property adds them up and outputs a string reporting the number of habits completed on that day.

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

Simple Habits

// Compressed
format(toNumber(prop("💧")) + toNumber(prop("🏃‍♂️")) + toNumber(prop("🏋️‍♀️")) + toNumber(prop("🥦"))) + "/4" + if((toNumber(prop("💧")) + toNumber(prop("🏃‍♂️")) + toNumber(prop("🏋️‍♀️")) + toNumber(prop("🥦"))) == 1," Habit"," Habits")

// Expanded
format(
    toNumber(
        prop("💧")
    ) + 
    toNumber(
        prop("🏃‍♂️")
    ) + 
    toNumber(
        prop("🏋️‍♀️")
    ) + 
    toNumber(
        prop("🥦")
    )
) + 
"/4" + 
if(
    (
        toNumber(
            prop("💧")
        ) + 
        toNumber(
            prop("🏃‍♂️")
        ) + 
        toNumber(
            prop("🏋️‍♀️")
        ) + 
        toNumber(
            prop("🥦")
        )
    ) == 1,
    " Habit",
    " Habits"
)

© Thomas Frank