filmov
tv
IF Statement in Excel Based On Cell Color - Excel Formula

Показать описание
In this video, I will show you how to use the IF statement in Excel based on colors to perform a logical test.
I’m using the COLORMATCH function to compare two cell colors. The function uses two arguments: the cells you want to compare and the price you want to increase. In the first example, I want to increase the price by 20% if the cell color is green. If the cell color is not green, we keep the price untouched.
The COLORMATCH returns TRUE in case of a match and gets FALSE in case of different colors. Using this method, you can handle complex logical expressions easily. In the second example, the first condition remains the same. We will increase the price if the cell color is green. But if the cell is purple, we want to apply a discount of 20%.
Chapters:
00:00 Intro
00:20 The COLORMATCH Function
00:53 How to use the IF statement based on colors
01:55 Multiple conditions - Nested IF statement based on colors
Download DataFX free function library:
If you want to use the COLORMATCH function, insert a new module, paste the code, and save a Workbook as an xlsm format.
Function COLORMATCH(cell1 As Range, cell2 As Range) As Boolean
Dim color1 As Long
Dim color2 As Long
COLORMATCH = (color1 = color2)
End Function
🔔 SUBSCRIBE if you’d like more tips and tutorials like this.
🎁 SHARE this video and spread the Excel love.
Or if you are in a hurry, please click the 👍
#excel #exceltips #exceltutorial #excelformula
I’m using the COLORMATCH function to compare two cell colors. The function uses two arguments: the cells you want to compare and the price you want to increase. In the first example, I want to increase the price by 20% if the cell color is green. If the cell color is not green, we keep the price untouched.
The COLORMATCH returns TRUE in case of a match and gets FALSE in case of different colors. Using this method, you can handle complex logical expressions easily. In the second example, the first condition remains the same. We will increase the price if the cell color is green. But if the cell is purple, we want to apply a discount of 20%.
Chapters:
00:00 Intro
00:20 The COLORMATCH Function
00:53 How to use the IF statement based on colors
01:55 Multiple conditions - Nested IF statement based on colors
Download DataFX free function library:
If you want to use the COLORMATCH function, insert a new module, paste the code, and save a Workbook as an xlsm format.
Function COLORMATCH(cell1 As Range, cell2 As Range) As Boolean
Dim color1 As Long
Dim color2 As Long
COLORMATCH = (color1 = color2)
End Function
🔔 SUBSCRIBE if you’d like more tips and tutorials like this.
🎁 SHARE this video and spread the Excel love.
Or if you are in a hurry, please click the 👍
#excel #exceltips #exceltutorial #excelformula
Комментарии