Conditional highlighting using a formula
In Word for Mac, we can highlight cells based on a formula. Is there a way to get the same in Numbers,too?
MacBook Pro with Retina display, OS X Mavericks (10.9.4), iPhone 4S
In Word for Mac, we can highlight cells based on a formula. Is there a way to get the same in Numbers,too?
MacBook Pro with Retina display, OS X Mavericks (10.9.4), iPhone 4S
Yes, AppleScript can be handy for doing certain things in Numbers.
I haven't built any error trapping into the script (that takes time and I wasn't sure whether the script would be useful on your end). I don't get the error here and am not sure what is causing it though I'm guessing you may have a non-number somewhere in columns D through F. Try clearing the error up with a 'try' and 'end try', as in the variation below ('try' tells AppleScript what to do when it encounters an error, much like IFERROR in Numbers).
SG
property startCol : 4
property endCol : 6
tell application "Numbers"
set t to front document's active sheet's first table whose selection range's class is range
tell t to repeat with r from (1 + header row count) to (row count - footer row count)
set rv to row r's cells's value
set v to rv'sitemsstartCol thru endCol
if my sumList(v) = 0 then set row r's cells startCol thru endCol's text color to "white"
end repeat
end tell
to sumList(lst)
set sum to 0
repeat with i in lst
try
if i is not "missing value" then set sum to sum + i
end try
end repeat
end sumList
Hi SGIII,
Thank you very much.
I put the "try......end try" inside "tell ........ end tell" block, and hurray!
So nice of you to let me know of Numbers and AppleScript capability.
Finally, I thought of shifting to Numbers from Excel.
Regards,
Naikosen
Here is a really clear video that shows how to use formulas and reference other fields with conditional formatting in Numbers 3.
macmost.com/conditional-highlighting-in-numbers.html
Conditional highlighting using a formula