How to Use REGEXMATCH for Highlighting the Current Month?

  • Thread starter Thread starter Steven Ellet
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on using the REGEXMATCH function in Excel to highlight cells corresponding to the current month. The initial formula provided is =IF(REGEXMATCH(B1,"May"), 1, 0), which needs modification to dynamically reference the current month. A cell lookup formula is proposed to replace the static month name with a dynamic reference based on the current date, utilizing the MONTH and TODAY functions. The solution effectively allows for highlighting cells in columns B and C based on the current month.

PREREQUISITES
  • Familiarity with Excel functions, specifically IF and REGEXMATCH.
  • Understanding of date functions in Excel, particularly MONTH and TODAY.
  • Basic knowledge of conditional formatting in Excel.
  • Experience with cell referencing and lookup techniques in Excel.
NEXT STEPS
  • Learn how to implement conditional formatting in Excel to highlight cells based on formulas.
  • Explore advanced REGEX functions in Excel for more complex text matching.
  • Research dynamic cell referencing techniques in Excel for improved formula flexibility.
  • Study the use of Excel's TEXT function to format dates and months for better presentation.
USEFUL FOR

This discussion is beneficial for Excel users, data analysts, and anyone looking to automate cell highlighting based on dynamic date criteria.

Steven Ellet
Messages
85
Reaction score
3
Current Formula =IF(REGEXMATCH(B1,"May"), 1, 0)
Problem: I am trying to find a way to replace "May" with a cell lookup.
Goal: Highlight any cell with current month (in this case, May) in B:B or C:C (if I need 2 formulas, that is fine)
Extra info:
Cell lookup: =IF((MONTH(TODAY()))=1,"January",IF((MONTH(TODAY()))=2,"February",IF((MONTH(TODAY()))=3,"March",IF((MONTH(TODAY()))=4,"April",IF((MONTH(TODAY()))=5,"May",IF((MONTH(TODAY()))=6,"June",IF((MONTH(TODAY()))=7,"July",IF((MONTH(TODAY()))=8,"August",IF((MONTH(TODAY()))=9,"September",IF((MONTH(TODAY()))=10,"October",IF((MONTH(TODAY()))=11,"December",IF((MONTH(TODAY()))=12,"May"))))))))))))
 
Computer science news on Phys.org
Case solved
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 29 ·
Replies
29
Views
5K
Replies
2
Views
2K
Replies
44
Views
5K
Replies
2
Views
12K
  • · Replies 6 ·
Replies
6
Views
8K
Replies
15
Views
4K
  • · Replies 11 ·
Replies
11
Views
5K