2021年4月3日星期六

Google Sheets 'Text' function & Conditional Formatting

Is there any way to use the 'TEXT' function in the Google sheets Conditional Formatting sidebar?

For example, if ten rows need to be formatted as currency, based on a text description value in column A -- can a custom formula be used to execute the 'consequence' of an IF/THEN... if a TRUE condition exists?

Desired Format Rules/ Custom Formula (since 'number formatting' is not a viable 'Conditional Formatting option): Apply to range 1:1 =IF(a1="REVENUE", TEXT(a3,"$#,##0.00")) (the flag in a1 will dictate the row formatting)

Trying to AVOID having to iterate through all rows using code (such as the sample below) and instead check for the 'flag' column and apply the required formatting in the UI.

var ss = SpreadSheetApp.getActiveSpreadsheet().getSheetByName('sheet1'); var values = ss.getRange('a1:a10').getValues(); values.forEach(row=>{if (Range=="REVENUE") {ss.getRange(r,1).setNumberFormat("$#,##0.00")}}....

https://stackoverflow.com/questions/66937434/google-sheets-text-function-conditional-formatting April 04, 2021 at 10:06AM

没有评论:

发表评论