Build a comparison table/chart
I found a chart that I wanted to show you how to build. It contains values both horizontally and vertically, the intersecting cells are colored based on conditions.
The printable planting guide is found here. This is what the color means:
Light green : Plants grow well together.
Red : Don't plant together.
Dark green : The combination helps bug control.
Yellow : Carrots will have good flavor but stunted roots.
Grey : Beneficial to the garden in general.
What's on this page
- How to transpose values vertically to horizontally?
- How to orient cell values vertically?
- How to change column width for multiple columns simultaneously?
- How to apply cell background color using conditional formatting?
- How to hide cell values using cell formatting?
- How to create cell borders?
- Get Excel *.xlsx file
Start typing the plant names in cell A2 and continue with cells below.
1. How to transpose values vertically to horizontally?
The animated image above shows a smaller set of values being transposed.
- Select cells in cell range A2:A31.
- Copy cells.
- Select the destination cell.
- Press with left mouse button on the "Paste" button. A pop-up menu appears.
- Press with left mouse button on the "Transpose" button.
2. How to orient cell values vertically?
The image above shows cell values in B1:D1 aligned vertically.
- Select cell range B1:AE1.
- Press with right mouse button on on cell range B1:AE1. A pop-up menu appears.
- Press with left mouse button on "Format Cells..." on the pop-up menu. A dialog box shows up, see image below.
- Go to tab "Alignment".
- Change "Orientation" to 90 degrees, see image above.
- Press with left mouse button on OK button to apply settings..
3. How to change column width for multiple columns simultaneously?
The animated image above shows how to change column width by dragging the column border with the mouse.
- Select columns B:AE.
- Press and hold with left mouse button on any column border.
- Drag with mouse until column width is around 20 pixels,
- Release the left mouse button.
Tip!
- Select columns B:AE.
- Doublepress with left mouse button on with left mouse button on any column border in B:AE.
This adjusts the column width to the text.
4. How to apply cell background color using conditional formatting?
The image above shows the cell grid populated with numbers, we are going to color the cell background using Conditional Formatting based on these numbers.
- Type 1 for green, 2 for red, 3 for grey, 4 for dark green and 5 for yellow in cell range B2:AE31.
- Select cell range B2:AE31 and go to tab "Home" on the ribbon.
- Press with left mouse button on "Conditional formatting" button.
- Press with left mouse button on "New Rule..".
- Select "Use a formula to determine which cells to format", see image below.
- Type =B2=1
- Press with left mouse button on "Format..." button.
- Go to tab "Fill".
- Pick a color.
- Press with left mouse button on OK button twice.
Repeat above steps for cell values 2, 3, 4, and 5 but the formulas become =B2=2, =B2=3 , B2=4 and B2=5 and pick different fill colors.
4.1 Explaining conditional formatting formula
Conditional formatting formula:
Step 1 - Relative cell reference
B2 is a relative cell reference, it changes when the CF formula moves to the next cell. For example, the CF formula moves to cell B3 and the relative cell reference then changes to B3.
This evaluates the contents of each cell and colors the corresponding cell background based on the its cell value.
Step 2 - Cell value is equal to 1
The equal sign compares the contents of cell B2 to 1.
B2=1
becomes
""=1
and returns FALSE.
Step 3 - Evaluate TRUE and FALSE
If the logical expression returns TRUE the cell background changes to green. If FALSE then nothing happens.
5. How to hide cell values using cell formatting?
The image above shows the cell grid without the numbers only cell background colors. The numbers are still there, however, you can't see them. Select a cell and the number shows up in the Formula bar.
Here is how to hide the numbers in cell range B2:AE31.
- Select B2:AE31.
- Press CTRL + 1. A dialog box appears.
- Press with left mouse button on "Custom" category, see image below.
- Type ;;;
- Press with left mouse button on OK button to dismiss the dialog box and apply settings..
6. How to create cell borders?
The image above shows cell range A1:AE31 selected. Here is how to insert borders to cell range A1:AE31:
- Select A1:AE31.
- Go to the "Home" tab on the ribbon.
- Press with left mouse button on "Borders". A pop-up menu shows up.
- Select "All Borders".
You could color each cell manually, but in my opinion, building this chart is a lot easier using cell numbers.
Articles on the same subject
Heat map using pictures | Use a map in an excel chart | Shift Schedule | Dynamic Gantt charts in excel 2007 | Dynamic chart – Display values from a table row or column
Question: How do I create a chart that dynamically adds the values, as i type them on the worksheet? Answer: […]
I recently discovered an interesting technique about using a user defined function in a HYPERLINK function. Jordan at the Option […]
In this article I will demonstrate how to quickly change chart data range utilizing a combobox (drop-down list). The above […]
This article demonstrates macros that automatically changes the chart bar colors based on the corresponding cell, the first example is […]
The calendar shown in the image above highlights events based on frequency. It is made only with a few conditional […]
This Gantt chart uses a stacked bar chart to display the tasks and their corresponding date ranges. Completed days are […]
This chart is an arrow chart that has horizontal and vertical lines, positive arrows are green and negative arrows are […]
The picture above shows the following equation x^3+3*x^2-3 plotted on an x y scatter chart. Here are the instructions on how […]
Leave a Reply
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.