
Suppose, you have a list of products that includes units in stock, delivery and other details. Apply an icon set based on other cells in a row (blanks vs. With just a little creativity, you can assign icons depending on the values of other cells in a row or based on another cell's value, as demonstrated in the following examples.
Databar excel for mac how to#
How to apply an Excel icon set based on other cells' valuesĪ common opinion is that Excel conditional formatting icon sets can only be used to format cells based on their own values.
To assign icons based on a cell's value instead of specifying a number or percent, type the cell's address in the Value box or click the Collapse Dialog icon to select a cell, as shown in the screenshot below. To hide the cells' values, select the Show Icon Only check box. To change the order of icons, click the Reverse Icon Order button. I have decided to stick with the same icons but assign them in a different way: underneath the icon sets list to bring up the New Formatting Rule dialog.įrom here you are able to choose other icons and assign them to different values. I cannot say that Excel has interpreted the data in the way I wanted, so let's customize the icon set a bit. In the screenshot above, you can see a table listing the household spendings with a green circle representing the highest value and red circles lower values. You apply the icon sets to your data by clicking Conditional Formatting > Icon Sets, and the icons appear inside selected cells straight away. Let's quickly go through them, one at a time.Įxcel conditional formatting icon sets will help you visually represent your data with arrows, shapes, check marks, flags, rating starts and other objects. When you click the Conditional Formatting button, a drop-down menu offers you a handful of pre-defined formatting rules. If you already know the basics, let's move on and see what format options you have with regard to Excel's icon sets, color scales and data bars and how you can leverage them for your projects. If you have not got a change to read that article, you may want to do this know. Last week we started to explorer various features and capabilities of Conditional formatting in Excel 2016, 20. It will teach you how to extend these conditional formats beyond their common uses and apply icons based on another cell's value. article provides the detailed guidance on how use conditional formatting Icon Sets, Data Bars and Color Scales in Excel 2019, 2016, 2013, and 2010.
' Sets the color based on what value has been passed to the sub Modify newtype:=xlConditionValueNumber, newvalue:=1
' Sets the maximum limit of the data bar to +1 Modify newtype:=xlConditionValueNumber, newvalue:=-1 ' Sets the minimum limit of the data bar to -1 ' Sets the databar fill type to display as gradientĭ = xlDataBarBorderSolidĭbar.AxisPosition = xlDataBarAxisMidpoint ' Creates a databar object for the databar that has been added to the cell ' Clears existing conditional formatting from the cell
Sub Add_Data_Bar(rngCell As Range, dblValue As Double)
' If the value is less than -0.1 and greater than -.2, OR greater than 0.1 and less than 0.2 then yellow bars ' If the value is greater than or equal to -0.1 and less than or equal to 0.1, then display green bars ' The value in the cell is expected to be decimal numbers between -1 and 1 ' The purpose of this sub is to add a data bar to an individual cell The result is shown in the link below the code. Instead of creating conditional formatting for a range of cells, I conditionally formatted each cell individually using VBA based on the two subs below.