IF Statement in Excel Based On Cell Color - Excel Formula

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ย. 2024

ความคิดเห็น • 17

  • @stuartlawson6991
    @stuartlawson6991 7 หลายเดือนก่อน +22

    It's worth pointing out that the "colormmatch" function mentioned here is not an in-built Excel function. It has to be added via external libraries or VBA, neither of which may be possible if your Excel is locked down.

    • @excelkid
      @excelkid  7 หลายเดือนก่อน +2

      Unfortunately, one of the most painful shortcomings of the LAMBDA function is that it cannot access Excel's object model. If this helps you, then I will place here the COLORMATCH function, which is extremely simple. With the code provided, you can now use the function independently, without necessarily having to install the add-in
      Function COLORMATCH(cell1 As Range, cell2 As Range) As Boolean
      Dim color1 As Long
      Dim color2 As Long
      color1 = cell1.Interior.color
      color2 = cell2.Interior.color
      COLORMATCH = (color1 = color2)
      End Function
      Another painful issue is that LAMBDA is only compatible with the latest versions of Excel, while VBA is compatible with everything

    • @tonyashort4012
      @tonyashort4012 2 หลายเดือนก่อน +1

      can you share the VBA code please?

    • @excelkid
      @excelkid  2 หลายเดือนก่อน

      Function COLORMATCH(cell1 As Range, cell2 As Range) As Boolean
      Dim color1 As Long
      Dim color2 As Long
      color1 = cell1.Interior.color
      color2 = cell2.Interior.color
      COLORMATCH = (color1 = color2)
      End Function

  • @jhanfeifoo734
    @jhanfeifoo734 8 หลายเดือนก่อน +8

    How come colormatch formular is not available in my excel ?

    • @excelkid
      @excelkid  8 หลายเดือนก่อน

      Hello, we built a function library, DataFX. You can download it free: exceldashboardschool.com/free-excel-add-ins-tools/

    • @ASAmmu-qs8gq
      @ASAmmu-qs8gq 2 หลายเดือนก่อน +2

      you dont have advance excel so that's formula cannot work

  • @marcopio1000
    @marcopio1000 8 หลายเดือนก่อน +1

    Thank you!! i change a color afterwards, the formula do not update automatically, i have to click in the cell... is there a way to let it update like all the other excel formulas?

    • @excelkid
      @excelkid  8 หลายเดือนก่อน

      Hi, First, navigate to the Excel Options panel by clicking "File," then "More," then "Options." This opens the "Options" panel in a pop-up window. Select "Formulas" from the menu on the left of the panel. This brings you to a page with the message "Change options related to formula calculation, performance, and error handling" at the top. The first set of controls underneath this message is the "Calculation options."

  • @RSWALM1955
    @RSWALM1955 8 หลายเดือนก่อน

    Thank you for this detailed and very useful video. It gave me exactly what I was looking for. My question is the same as marcopio1000. when I change a cell's color I have to recopy the formula from above cell to reset the value I am calculating. I went into options and my calculations is set to Automatic. I did not see anything else to which you might have been referencing when you answered marcopio's question. Thoughts? Thanks again.

    • @excelkid
      @excelkid  8 หลายเดือนก่อน

      Thank you for your question. It seems that you are experiencing an issue where the COLORMATCH function doesn't automatically recalculate when you change the color of a cell in Excel. This is because Excel's calculation engine does not recognize a change in cell format (like color) as a trigger to recalculate. Therefore, functions that rely on formatting rather than cell content won't update automatically in the way that functions depending on values do.
      Here are a few thoughts and suggestions to address this issue:
      1. Manual Recalculation: You can manually force a recalculation by pressing F9. This will recalculate all functions in the workbook, not just the COLORMATCH function.
      2. VBA Event: Use a VBA event to trigger a recalculation whenever a cell's color is changed. This could be done using the Worksheet_Change or Worksheet_SelectionChange event, but it might require extensive VBA programming and could potentially slow down your workbook if not implemented efficiently. [We will not implement this!]
      3. Conditional Formatting: If possible, consider using conditional formatting in conjunction with your function. Conditional formatting inherently responds to changes in cell values and can trigger visual updates without the need for manual recalculation.
      4. Workbook Calculation Options: Although you've set calculations to Automatic, sometimes, setting it to 'Automatic Except for Data Tables' and then back to 'Automatic' can resolve issues. This is not directly related to your problem but can help reset any anomalies within the Excel calculation engine.

  • @Spaatz77
    @Spaatz77 7 หลายเดือนก่อน

    Hi. Your tool set looks great. I am attempting to install the ExcelDna.IntelliSense64.xll fileand DFX.xlam extension to Excel 2010 on a Windows 7 system. I am getting file extension mismatch and a security certificate warning. The ExceDna.IntelliSense64.dll file opens at a corrupted text Excel file. Any thoughts how to fix?

    • @excelkid
      @excelkid  7 หลายเดือนก่อน

      Hi! It's difficult to determine what the issue might be because several versions of Excel are no longer supported.
      - Excel 2010: Support ended on October 13, 2020.
      - Excel 2013: Support ended on April 11, 2023.
      - Excel 2016: Mainstream support ended on October 14, 2021, while extended support ended on October 14, 2026.
      - Excel 2019: Mainstream support will end on October 10, 2024, while extended support will end on October 14, 2029.

  • @AjayKumar-q9w8n
    @AjayKumar-q9w8n 7 หลายเดือนก่อน +1

    Can i use this on Google Sheets ?

    • @excelkid
      @excelkid  7 หลายเดือนก่อน

      Hi, this function is for Excel. We are really thinking of implementing the library for Google Sheets.

  • @samsunggalaxya71silver13
    @samsunggalaxya71silver13 6 หลายเดือนก่อน

    ممنون از توضیحات خوبتون🙏

  • @AML1612
    @AML1612 6 หลายเดือนก่อน +1

    Is it possible to use the colormatch function to count how many cells within a range are a certain color?