N
N
nurakhov2017-05-17 15:44:52
JavaScript
nurakhov, 2017-05-17 15:44:52

How to insert range reference into Google Spredasheets conditional formatting formula?

The problem is this.
I'm making another calendar, there are 365 cells with dates, I need to "conditionally format" these cells in such a way as to mark weekends and holidays with color.
I write the formula:
=or(weekday(cell with date; 2) = 6; weekday(cell with date; 2) = 7), it
works without problems, all weekends are marked.
Next, I have a column with holiday dates.
I add the formula:
=or(weekday(cell with date; 2) = 6; weekday(cell with date; 2) = 7; countif(range of holidays; cell with date)=1),
does not work .
I make a separate rule with the formula:
=countif(range of holidays; cell with date)=1,
doesn't work .
I write the same formula in a cell, it returns True (i.e., the formula is correct).
IMHO, it does not work with a range, because interposed instead of a range the reference to a separate cell - fulfilled, painted.
What to do?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Spirin, 2018-07-31
@rockon404

1. And now the main question. Why was it necessary to implement module pattern in an ES6 module ? It makes absolutely no sense. Practice by practice, but still.
2. There is also no practical sense in the presence of the posts variable. 3. Feature:

async function _getPostById(id) {
    const post = await HTTP.get(`posts/${id}`)
    return post
  }

You can safely replace it with:
The same can be done with the _getPosts function .
4. Somewhere let, somewhere var, somewhere const. There is no logic in preferring one keyword over another. Read modern airbnb guidelines, for example.
5. Some semicolons are there, some are not. It's annoying to read this kind of code.

L
longclaps, 2018-07-31
@longclaps

I have never seen anything more beautiful in my life.
Keep walking.

D
Dmitry Belyaev, 2018-07-31
@bingo347

Put eslint + plugin in your editor to it - this will help to maintain a uniform code style throughout the project.
As Anton Spirin already wrote - there are semicolons somewhere, somewhere they don’t, it hurts your eyes ...
Again, the module pattern only worsens the code, at least with an extra indent, and also unnecessary _ at the beginning of names, which is not export - then and so it will not go beyond the module, I have to jump my eyes over the code in order to understand what you are exporting.
Well, a couple of notes:
1. do not use array.map if there is no task to get a new array, use array.forEach
bad: https://github.com/emilov2501/module-pattern/blob/...
good: https:/ /github.com/emilov2501/module-pattern/blob/...
generally tin:https://github.com/emilov2501/module-pattern/blob/...
2. If a function can be reused, it's better to reuse, rather than produce 100500 functions in memory that do the same thing:
https://github.com/ emilov2501/module-pattern/blob/...
3. Consider more meaningful names:
https://github.com/emilov2501/module-pattern/blob/...
if the function starts with get, fetch etc. prefix . - somehow it is expected that it will return something, here it is more logical to give prefixes like show
4. redundant code:
https://github.com/emilov2501/module-pattern/blob/...
https://github.com /emilov2501/module-pattern/blob/...
https://github.com/emilov2501/module-pattern/blob/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question