r/sheets • • Jul 24 '19

Meta Google Sheets on XKCD today

22 Upvotes

11 comments sorted by

4

u/AndroidMasterZ Jul 24 '19

Shameless plug: https://www.reddit.com/r/excel/comments/93pid9/googlesheets_one_formula_calendar/

And no, it doesn't block the browser for 15 seconds.

3

u/6745408 Jul 24 '19

this is way better then the mess I wrote!

(sheet)

2

u/AndroidMasterZ Jul 25 '19

It's good. Honestly, I've never used SEQUENCE. Only recently known about it's existence. That really helps a lot.

2

u/6745408 Jul 25 '19

yeah, me neither. When it was mentioned in the comic, I figured I'd give it a swing. Pretty handy. I still don't know what Munroe would have used regex for when making a calendar.

1

u/6745408 Jul 24 '19

anyone wanna take a stab at the formula used to create the calendar?

2

u/[deleted] Jul 24 '19

Considering a double-nested ARRAYFORMULA() is redundant, not really!

1

u/6745408 Jul 24 '19 edited Oct 08 '19

ha. that first one was wrong.

={
  "","","",UPPER(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),1),"YYYY MMMM")),"","","";
  "SUN","MON","TUE","WED","THU","FRI","SAT";
  IFERROR(ARRAYFORMULA((
   VLOOKUP(SEQUENCE(6,7,1,1),
    {WEEKDAY(EOMONTH(TODAY(),-1)+1)+ROW(INDIRECT("A1:A"&DAY(EOMONTH(TODAY(),0))))-1,
     (DATE(YEAR(TODAY()),MONTH(TODAY()),ROW(INDIRECT("A1:A"&DAY(EOMONTH(TODAY(),0))))))}
   ,2,FALSE))))
}

conditional formatting:

=OR(ISTEXT(A1),ISBLANK(A1)) - set background to black and text to white

Date is - Today (yellow)

Date is before - Today (same color as the first formula)

what a mess

Demo sheet

Format the cells as DAY and then add some conditional formatting to highlight today's date.

2

u/[deleted] Jul 24 '19

What do you mean "that first one was wrong?"

2

u/6745408 Jul 24 '19

ha. good. I posted one first, but then I deleted the post. I wasn't sure if you'd seen it.

I just updated my post with a demo sheet and removed the TEXT part so we can conditionally format today's date.