gangsraka.blogg.se

Compare two columns in excel and highlight same values
Compare two columns in excel and highlight same values









The red icons represent the negative changes (Week 2 is less than Week 1), green icons show the positive changes (Week 2 is more than Week 1), and yellow icons show the times when there was no change between the weeks. The conditional formatting icons have been applied to column C: To close the dialog box and apply the conditional formatting, click OK.

compare two columns in excel and highlight same values

There is also an option to change the icon style. Since the values are there simply to facilitate the conditional formatting, there is no reason for users to see them. This will remove the values (0, 1, 2) and show only the icons. In the second line (the yellow arrow), change the Type to Number and the Value to 1.īefore closing the dialog box, we want to click the check box to Show Icon Only. To change the values, in the first line (the green arrow), change the Type to Number and the Value to 2. From the drop-down list, choose an icon set. In the bottom half of the dialog box, we see the options for Value and Type of comparison.īefore making other changes, we need to choose our Icon Style. We want to use the 3 Arrows (Colored) icons to compare numbers. The default setting is to compare percentages with the 3 Traffic Lights (unrimmed) icons. The New Formatting Rule dialog box appears. From the drop-down menu, click Icon Sets, then click More Rules…. On the Home tab, in the Styles Group, click the Conditional Formatting button. To apply conditional formatting to the values in column C, if necessary, select the values in column C. The result, “0”, should appear in cell C2.Ĭopy the IF function to the rest of the cells in column C: In cell C2, type the nested IF function: =IF(A2>B2, 0, IF(A2 compare two columns in excel and highlight same values

The logic behind the IF function is this: if a condition is met, then do one thing, if the condition is not met, then do another.

compare two columns in excel and highlight same values

We will be using the IF function to compare our columns. We will compare the two weeks to see if there is a negative or positive change, or no change at all.

compare two columns in excel and highlight same values

As you can see, the worksheet includes data for two different weeks. This conditional formatting can be accomplished by combining an icon set with an IF statement. If column A is less than column B, a second icon would appear or if columns A and B are equal, a third icon would be displayed. What if you would like to compare two columns of data and use conditional formatting to give users a visual representation of the comparison? For example, if column A is greater than column B, a particular icon would appear.











Compare two columns in excel and highlight same values