Red Gregory

View Original

5 Ways To Count Down The Year With A Notion Progress Bar

See this content in the original post

The Basic Syntax

This is how to return a progress bar and percentage from a decimal. Test it with these properties:

  1. Number labeled “A” (smaller number)

  2. Number labeled “B” (larger number)

  3. Formula

if(prop("A") / prop("B") < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * prop("A") / prop("B"))) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * prop("A") / prop("B")))) + " " + format(floor(prop("A") / prop("B") * 100)) + "%"

Note: you can always change the symbol designs inside the formulas.

See (Mo-Su) Weekly Progress Bar alternatives via link at bottom of the article.

The Table Formulas

If you want to view the Year, Month, Week, and Day’s progress in a Notion table, you can use the following formulas. Again, this does not require additional properties; only a formula for each.

1. Progress Percentage

Year

floor(100 * (month(now()) + 1) / 12) / 100

Month

floor(100 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days"))) / 100

Week (Su-Sa)

floor(100 * (day(now()) + 1) / 7) / 100

Day

floor(100 * (hour(now()) + 1) / 24) / 100

2. Minimal Progress Bars

Year

if((month(now()) + 1) / 12 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (month(now()) + 1) / 12)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (month(now()) + 1) / 12)))

Month

if(date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")) < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))))

Week (Su-Sa)

if((day(now()) + 1) / 7 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (day(now()) + 1) / 7)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (day(now()) + 1) / 7)))

Day

if((hour(now()) + 1) / 24 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (hour(now()) + 1) / 24)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (hour(now()) + 1) / 24)))

3. Progress Bar And Percentage

Year

if((month(now()) + 1) / 12 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (month(now()) + 1) / 12)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (month(now()) + 1) / 12))) + " " + format(floor((month(now()) + 1) / 12 * 100)) + "%"

Month

if(date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")) < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days"))))) + " " + format(floor(100 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))) + "%"

Week (Su-Sa)

if((day(now()) + 1) / 7 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (day(now()) + 1) / 7)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (day(now()) + 1) / 7))) + " " + format(floor((day(now()) + 1) / 7 * 100)) + "%"

Day

if((hour(now()) + 1) / 24 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (hour(now()) + 1) / 24)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (hour(now()) + 1) / 24))) + " " + format(floor((hour(now()) + 1) / 24 * 100)) + "%"

The Gallery Formulas

To create a gallery view in Notion locate the button next to the title of a database and create a new Gallery.

To show formulas, locate the database menu (…) located at the top right-hand corner of every database and select Properties. Toggle all formulas you want to see.

Viewing formulas in a gallery card can be tricky in Notion, so I modified them to return the name of the formula in addition to the above formulas.

4. Gallery Progress Bars

Year

if((month(now()) + 1) / 12 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (month(now()) + 1) / 12)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (month(now()) + 1) / 12))) + " Year"

Month

if(date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")) < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days"))))) + " Month"

Week (Su-Sa)

if((day(now()) + 1) / 7 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (day(now()) + 1) / 7)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (day(now()) + 1) / 7))) + " Week"

Day

if((hour(now()) + 1) / 24 < .1, "◼◻◻◻◻◻◻◻◻◻", slice("◼◼◼◼◼◼◼◼◼◼", 0, floor(10 * (hour(now()) + 1) / 24)) + slice("◻◻◻◻◻◻◻◻◻◻", 0, 10 - floor(10 * (hour(now()) + 1) / 24))) + " Day"

5. Gallery Percentages

Year

"Year: " + format(floor(100 * (month(now()) + 1) / 12) / 100 * 100) + "%"

Month

"Month: " + format(floor(100 * date(now()) / date(dateSubtract(dateAdd(dateSubtract(now(), date(now()) - 1, "days"), 1, "months"), 1, "days")))) + "%"

Week (Su-Sa)

"Week: " + format(floor(100 * (day(now()) + 1) / 7) / 100 * 100) + "%"

Day

"Day: " + format(floor(100 * (hour(now()) + 1) / 24) / 100 * 100) + "%"

Further Reading

See this gallery in the original post