Conditional Formatting with Named Range

gberg

Board Regular
Joined
Jul 16, 2014
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I want to use conditional formatting for cells that contain the value of a named range. "Year_Current" is the named range I am referencing and the cell it references is the current year, 2022.

I am using this formula =$G3=INDIRECT("Year_Current") in the conditional formatting which works fine for cells with 2022. I also want to use conditional formatting to highlight cells with years 2023 and 2024. I tried these but they did not work

=$G3=INDIRECT("Year_Current+1")
=$G3=INDIRECT("Year_Current"+1)

Any ideas?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this:
=$G3=(INDIRECT("Year_Current")+1)
 
Upvote 0
I don't think you need the INDIRECT() function.

Excel Formula:
=$G3=Year_Current

Should work just as well.

And to format the next year, simply:

Excel Formula:
=$G3=Year_Current+1
 
Upvote 0
Solution
Well don't I feel silly. I was trying to make things more difficult, that works perfectly. Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,271
Members
449,219
Latest member
daynle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top