Last week we learned how to answer questions like, “How many tiles in a room?” using Excel. We learned about CONVERT function and fraction number format settings in Excel.
But why stop at calculation? We can even model a room full of tiles, thanks to Excel’s grid nature.
So today, we will learn how to create a room layout like this using Excel:
If you like the demo, read on to learn.
Step 1: Set up input cells
To model tiles in a room, we need 4 inputs. Lets call them by below names.
- room.length
- room.width
- tile.length
- tile.width
Step 2: Calculate number of tiles required
The basic formula for calculating total tiles required is this:
=ROUNDUP((room.length*room.width)/(tile.length*tile.width), 0)
But this formula yields in an unrealistic solution as we do not want to have fractional tiles everywhere. So, a better way to calculate this is,
=ROUNDUP(room.length / tile.length,0) * ROUNDUP(room.width / tile.width,0)
Although this formula is technically correct, you may save a few tiles if you rotate the them.
That is,
ROUNDUP(room.length / tile.width,0) * ROUNDUP(room.width / tile.length,0) can be smaller than ROUNDUP(room.length / tile.length,0) * ROUNDUP(room.width / tile.width,0) in some cases, as shown in above demo.
So we need a way to flip tile dimensions if that saves us a few bucks. That is done by,
Step 3: Flipping tile dimensions with a switch
Insert a check box and link to a blank cell, say F6.
[Related: How to use a check box in Excel]
Now, using F6 value (either TRUE or FALSE), flip the values of tile.length & tile.width using IF() formula.
Step 4: Create a 100×100 grid
Although you can model the floor plan of entire Buckingham palace in Excel, lets restrict ourselves to rooms of size 100×100.
Select 101 columns and resize them small enough so you can see all of them in a single screen, like 10 pixels wide.
Select 101 rows and adjust their height so that you can see as many of them as possible in a single screen (10 pixels tall should do).
Type running numbers in first column & row. The final grid looks this this:
Step 5: Modeling the room layout using conditional formatting
So we have a big 100×100 grid where we need to draw
- Outer boundary for the room as per room.length & room.width
- Inner tile boundaries as per tile.length & tile.width
Set up conditional formatting rules for room boundary
There are 4 rules required.
- Draw vertical left border if the topmost row = 1
- Draw vertical right border if the topmost row = room.length
- Draw horizontal top border if the left-most column = 1
- Draw horizontal bottom border if the left-most column = room.width
Below, see one of the rules.
You can find other conditional formatting rules in the downloadable workbook.
Step 6: Modeling Tiles using conditional formatting
While we need 4 rules for the room boundary, we just need 2 rules for tile boundaries.
- Draw vertical right border if the topmost row value is divisible by tile.length
- Draw horizontal bottom border if the left-most column value is divisible by tile.width
We do not need rules for vertical left border or horizontal top border because they will be drawn by previous tile.
See one of the rules below:
That’s all. Our room model is ready. Go ahead and see how it looks when tile it.
Download Example Workbook
Click here to download room tiles model workbook and play with it. Examine the conditional formatting rules to understand it better.
Do you apply Conditional Formatting in such creative ways?
I personally think conditional formatting is as good as honey, mangoes or dark chocolate. I love to use a dollop of it in all my Excel recipes.
What about you? Do you use conditional formatting for anything out-of-box 😉 like this? Please share your tips using comments.
Want more? Check out these conditional formatting examples
If you want more on conditional formatting you are in luck. Check out,
- Gantt chart using Excel conditional formatting
- Baby feeding schedule using conditional formatting
- Todo list using Excel conditional formatting
- Making data entry forms awesome with conditional formatting
- Searching data using conditional formatting
- Market segmentation charts with conditional formatting
- More examples on conditional formatting
8 Responses to “Create a Combination Chart, Add Secondary Axis in Excel [15 Second Tutorial]”
[...] Select the “daily completed” column and add it to the burn down chart. Once added, change the chart type for this series to bar chart (read how you can combine 2 different chart types in one) [...]
[...] set the height series to be plotted on secondary axis. Learn more about combining 2 chart types and adding secondary axis in [...]
[...] Excel Combination Charts – What are they? [...]
[...] To show the years, I have used another dummy series and plotted it on secondary axis (related: how to add secondary axis?) [...]
Thanks for this one!
[...] Choisissez la colonne « Daily Completed » et ajoutez-la au graphique. Une fois ajoutée, changez le type de graphique pour cette série à histogramme (lisez comment combiner 2 types de graphiques en un : combine 2 different chart types in one) [...]
How do i create a chart that has negative numbers on axis x and y and plot them correctly? I cannot seem to understand how to do this, please help.
Thanks.
Nat
You can also plot 2 or more Y axes in Excel using EZplot or Multy_Y from Office Expander.com
There is a demo version to try.
Cheers.