# How to (Simple) Progress Bar Chart According to "Stage"

**URL:** <https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850>\
**Category:** Ask the Community\
**Created:** [January 20, 2021, 7:27pm UTC](https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850 "2021-01-20T19:27:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benn\_Bennett](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/benn_bennett/32/7017_2.png) [@Benn\_Bennett](https://connect.superhuman.com/u/Benn_Bennett)\
**Post date:** [January 20, 2021, 7:27pm UTC](https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850/1 "2021-01-20T19:27:22Z")

</div>

Hello!

I have multiple users who go through various stages before they reach completion. I’m attempting to put them into a more “birds-eye-view” table/chart so I can quickly identify what steps to take next with each person. Visually, I’m looking for something like this: [Home & Cat Budgets (shared)](https://coda.io/d/Home-Cat-Budgets-shared_dqS8-xvTdWj/Budgeting_suWzW?utm_campaign=embed&utm_medium=web&utm_source=qS8-xvTdWj#_luwkz)

Simply put, my (selected) table columns would be something like this:

Name | Current Stage  
Doe, John | Beginning  
Doe, Jane | End  
Deer, John | Middle

I’m not much of an artist, so hopefully I described it accurately enough for someone to help me out.

Thanks!

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [January 26, 2021, 6:06pm UTC](https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850/2 "2021-01-26T18:06:52Z")

</div>

Hi @Benn_Bennett😊 : Would this work for you ? 😊

https://coda.io/embed/daFK8PRA2v/_suS0P?viewMode=embedplay&hideSections=true

Ok, I know my sample above will probably seem complicated 😅 , but it’s not 😉 .

What I did was this :

I’ve created a table `People & Stages`, a table `Stages` and a table `Colors` .

I used the `Stages` table to define the `Min %` , `Max %` and the `Max% - Min%` for each of the stages you’ve mentioned (Beginning, Middle and End). This table is link to the table `People & Stages` using a lookup so you can select the current stage for each person in the table.  
(The same thing was similarly done in the doc you shared in your post : with the `Max`, `Spent` and `Remaining` fields 😉 )

The `Colors` table is there so I can define the colors I’m using in the progress bar and because if you want to change the colors, it’s way easier that way 😊 .

Ok, now, for the ugly part 😅 : here’s what my progress bar formula actually looks likes :

```auto
SwitchIf(
	thisRow.Stages=Beginning,
		Concatenate(
			Rectangle(thisRow.Stages.Max*150,10,Colors.Filter(Usage="Current Stage").Hex),
			Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
			),
	thisRow.Stages=Middle,
		Concatenate(
			Rectangle(thisRow.Stages.Min*150,10,Colors.Filter(Usage="Passed").Hex),
			Rectangle(thisRow.Stages.[Max-Min]*150,10,Colors.Filter(Usage="Current Stage").Hex),
			Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
			),
	thisRow.Stages=End,
		Concatenate(
			Rectangle(thisRow.Stages.Min*150,10,Colors.Filter(Usage="Passed").Hex),
			Rectangle(thisRow.Stages.[Max-Min]*150,10,Colors.Filter(Usage="Current Stage").Hex)
	)
)

```

`SwitchIf()` is kind of working like `If()`, with the exception that you don’t need to precise the “`otherwise`” part of the formula, like you would do with an `If()` 😊 . And here, it would have become a long nested one …  
(More info about [SwitchIf()](https://coda.io/formulas#SwitchIf))

And basically, it says this :

If `Stages` = `Beginning` then `Concatenate()` this `Rectangle()` and this other `Rectangle()`.  
If `Stages` = `Middle` then `Concatenate()` this `Rectangle()`,this `Rectangle()` and this other `Rectangle()` too.  
If `Stages` = `End` then `Concatenate()` this `Rectangle()` and this other `Rectangle()`.

Now, the [Rectangle()](https://coda.io/formulas#Rectangle) formula looks like this : **`Rectangle(width, height, color, name)`**

As stated [in this topic](https://connect.superhuman.com/t/progress-bars-hsl-slider/7408) and specifically this part 👇 :

> [@Progress Bars & HSL Slider](https://connect.superhuman.com/t/progress-bars-hsl-slider/7408/1):
>
> I like to put rectangles next to each other whose lengths are inversely linked to some percentage

It means, in other words that you can put multiple rectangles next to each other (in a `Concatenate()` formula) and indicate as the `Width` for each of those rectangles a percent of the total `Width` of the whole bar 😊 .

For example, if I only take the `Concatenate()` for when the `Stage`=`Beginning` (where you just need 2 rectangles. One for the current stage and one for the rest) :

```auto
Concatenate(
 Rectangle(thisRow.Stages.Max*150,10,Colors.Filter(Usage="Current Stage").Hex),
 Rectangle(thisRow.Stages.Left*150,10,Colors.Filter(Usage="Left").Hex)
)

```

The **`Width`** of the first rectangle = **`thisRow.Stages.Max*150`**

`thisRow.Stages.Max` is the value I’ve put as a maximum percent for the `Beginning` stage in the table ` Stages`, which is here = `33%` (as you only have 3 stages (100/3 = ± 33)) .  
The `150` is the total `Width` of the “bar” (where the bar = the rectangle 1 + the rectangle 2).  
So **the actual `Width`** of that specific rectangle = **`33% of 150`** ( `thisRow.Stages.Max` **`*`** `150`)  
(Coda does the math here all by itself 😊 ).

For the **`Height`** I’ve used 10 😊 .

And the **`Color`** is the one I’ve define in the `Colors` table for the `Current` stage 😊

The second rectangle here follow the same principle but using the `Left %` 😊 .

And then, it all just begins again with the next `Stage` 😊 .  
(Except that you need 3 rectangles for the `Middle` stage : One to represent the passed stage, one for the current and one for the stage to come 😊 )

I did prefer to use a separated table for the colors because once the formula is set-up, you can easily change the colors (otherwise, you’ll need to modify accordingly each `Hex` value manually in each rectangles)

And of course, you can pre-define the `Total Width` of the “bar” and the `Height` by using sliders on the canvas (or others) (like in the doc you shared) the same way I pre-define the colors.  
You’ll just need to indicate in the diverse `Rectangle()` formulas where to get those values 😊 .

Note that 💡 : If you modify the text in the `Usage` field (which is used for the colors of the rectangles), you’ll need to update it also in the filters in the `Color` part of the `Rectangle()` formula 😊 .

Sorry, I it’s quite long but it’s not easy to explain with words 😇.

It might not be exactly what you wanted but I hope this help a little 😊 .

---

<div class="post-metadata">

**Author:** ![Benn\_Bennett](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/benn_bennett/32/7017_2.png) [@Benn\_Bennett](https://connect.superhuman.com/u/Benn_Bennett)\
**Post date:** [January 27, 2021, 4:41am UTC](https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850/3 "2021-01-27T04:41:40Z")

</div>

Wow. That’s a lot to digest but . . . wow. Thank you! I’m going to read that a couple times (or 8) and implement it. That’s amazing!

As an aside, I was toying around with other apps that compete with Coda, but the flexibility that it gives and, more importantly, the community that exists here, is AWESOME!

---

<div class="post-metadata">

**Author:** ![Pch](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/pch/32/17688_2.png) [@Pch](https://connect.superhuman.com/u/Pch)\
**Post date:** [January 27, 2021, 7:30am UTC](https://connect.superhuman.com/t/how-to-simple-progress-bar-chart-according-to-stage/20850/4 "2021-01-27T07:30:56Z")

</div>

@Benn_Bennett : You’re welcome 😊 !

Yeah, I know it’s a lot to read, sorry about that 😅 !

But creating a progress bar is not that complex, once you know the trick 😊 :

`Concatenate(Rectangle(),Rectangle(),Rectangle()) = Progress Bar`

Where the `Width` of each `Rectangle()` is a fraction (`%`) of the `Width` of the `Progress Bar`

I struggled to explain this in more concise way without omitting some info (which, who knows, could have been important) 😇 .

But I hope your implementation will be a success 😁 !
