Search code examples
google-sheetsgoogle-sheets-formula

Optimize formula for met condition


I have a Google Spreadsheet file created by using the "task list" template. I have this file as a TO-DO list for quickly record my daily activities.

This file/spreadsheet has the following structure:

Date Task
8/7/2024 Create a TO-DO list.
8/7/2024 Sort the notes.

etc.

Here is the sample spreadsheet.

On the A1 cell, I have the =TODAY() formula.

On the C1 cell, I have the following formula:

=CONCATENATE(COUNTIFS(B4:B;A1;A4:A68;TRUE); "/"; COUNTIF(B4:B;A1); " completadas  ") 

This formula is used for met this criteria:

Get the amount of task checked/completed on the current date.

My questions are:

  • Can this formula be "optimized"? - since (as is currently written), the second criteria (i.e. COUNTIF(B4:B;A1)) gets all dates regardless of the current date. I think there is a better way to generate a better formula, but, I'm struggling with a new one or even if I'm overthinking too much about it.
  • How can this formula be re-interpreted to match the requirement described above?

Solution

  • You may be overthinking it. Your current formula should work for all variations of input.

    You could simplify the formula by simply using ampersands in place of the concatenate function, but that comes down to preference of readability.

    =COUNTIFS(B4:B;A1;A4:A;TRUE) & "/" & COUNTIF(B4:B;A1) & " completadas  "