Written by Allen Wyatt (last updated November 14, 2022)
This tip applies to Excel 2007, 2010, 2013, and 2016
Conditional formatting is great at modifying the attributes of whatever text appears in a cell. However, Nadim needs a way to change the actual font using condtional formatting. He cannot use a macro to do this, so he wonders if there is a way to actually change the typeface used in cell through conditional formatting.
Nadim is correct—you cannot change the actual font through the use of conditional formatting. When you are setting up a conditional formatting rule you can click the Format button, which displays the Format Cells dialog box. Within the dialog box you can display the Font tab, but that doesn't allow you to change the font. The choices under the Font drop-down list are grayed out, and you can only change the font's attributes (Font Style, Color, etc.).
Many folks have complained about this shortcoming in Excel, but Microsoft has not seen fit to fix it yet. If you'd like, you can express your desire through Microsoft's "suggestion box" for Excel, here:
https://excel.uservoice.com/
If you poke around there you will undoubtedly discover that you aren't the only one pining for this capability.
At the current time, the only way around the problem is the way that Nadim says he cannot use—a macro.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (4273) applies to Microsoft Excel 2007, 2010, 2013, and 2016.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Need to know if a particular cell contains a date value? Excel doesn't have a worksheet function to determine this ...
Discover MoreYou may use Excel to track due dates for a variety of purposes. As a due date approaches, you may want that fact drawn to ...
Discover MoreWhen you paste information into a row that is conditionally formatted, you may end up messing up the rules applied to ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2023-08-17 14:56:07
J. Woolley
My previous comment below discussed Excel 365's TAKE function, which is NOT included in Excel 2021 or earlier. The following function in My Excel Toolbox provides capability similar to the TAKE function as well as Excel 365's DROP and EXPAND functions:
=Resize(RangeArray, [Rows], [Cols], [PadVal])
where RangeArray is a contiguous cell range or array constant or result of an array function. Rows is the number of rows to pick from the start, or ABS(Rows) from the end if < 0; default is 0 for all rows. Cols is the number of columns to pick from the start, or ABS(Cols) from the end if < 0; default is 0 for all columns. If ABS(Rows) or ABS(Cols) expands RangeArray, then added rows/columns are optionally set to PadVal.
Here is the formula from my previous comment using Resize instead of TAKE:
=SORT(Resize(UNIQUE(ROUND(RANDARRAY(10123,1,100.01,99999.99,FALSE),2)),10000))
See https://sites.google.com/view/MyExcelToolbox
2023-08-16 02:19:50
Michael van der Riet
This works fine as long as you realise that this generates pseudo-random sets and is unsuitable for heavy-duty apps. Best practice is to download true randoms. There are several pages that offer this, usually at no charge up to about a hundred thousand numbers. To reduce the hassle factor when I was calculating the odds on card games, I downloaded one large set that I could use many times, and used a pseudo-random to determine the offset into the set.
2023-08-13 11:52:30
J. Woolley
The Tip says, "...if you use the UNIQUE function, the list of values will be reduced by the number of duplicate values in the original list." This can be resolved by generating a larger list (like 10,123), then using Excel 365's TAKE function:
=SORT(TAKE(UNIQUE(ROUND(RANDARRAY(10123,1,100.01,99999.99,FALSE),2)),10000))
Note: The TAKE function is NOT included in Excel 2021 or earlier.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2023 Sharon Parq Associates, Inc.
Comments