Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9786

Google Sheets formula based on cell contents being bold

$
0
0

Is there a way to write a formula to do a lookup in another sheet to see if a cell is bolded?

Additional context:I am creating a fantasy football schedule. I'm trying to write either "vs" or "@" in a cell based on whether the indicated team is Home or Away. Another sheet indicates who is home or away via bolding the opponent's "team number" (i.e. Team 1 plays Team 10, etc.). Here's an abbreviated example of the sheet that has the data I believe I need and another of the schedule how I want it to look.

Team NumberTeam CodeWeek 1Week 2
1ME22
2B1311
WeekTeam NameCodeVS/@Team NameTeam Code
1Macksimum EffortMEvsB13 BoyzB13
1B13 BoyzB13@Macksimum EffortME
2Macksimum EffortME@B13 BoyzB13
2B13 BoyzB13vsMacksimum EffortME

I feel like there should be a way for me to use the Team Code to do a lookup based on the week value and check if the cell is bolded. If it is, I want to print in the "VS/@" column an "@" and if it isn't, I want to print a "VS". Is this possible? I can't seem to figure out the logical expression. I'm willing to write a script as well as I only need to run this once a year, but I'm not very well versed in how to set that up for this when I think a VLOOKUP is necessary.

function ifBold(a1Notation) {var cell = SpreadsheetApp.getActiveSpreadsheet().getRange(a1Notation);if(cell.getFontWeight() == 'bold')    return true;return false;

Viewing all articles
Browse latest Browse all 9786

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>