MrProgrammer wrote: ↑Fri Aug 09, 2024 4:05 pm
Explain what the result should be for that cell if the divisor is zero.
Griff wrote: ↑Fri Aug 09, 2024 5:57 pm
The above formula will produce a #DIV/0! error if target is not hit by end of month.
I asked you what you wanted to happen when the divisor is zero and didn't get an answer, so I used formua
=IF(C36;ROUNDUP(C35/C36);"Goal not achieved") in
202408091734.ods. The average is
undefined when no days remain. Providing a number for the average in that situation is nonsense. Any number is bogus.
My attached spreadsheet uses conditional formatting and
styles. Styles are required for conditional formatting. Conditional formatting
• in C2:E32 eliminates
all of your IF(ISBLANK();…;…) tests,
• in E35 supplies
Finished when needed, and
• in E2:E32 shows negative differences with a red background.
To see what happens at the end of the month put 39 in every cell in the range B10:B32. After viewing that result put 38 in every cell in that range.
Griff wrote: ↑Fri Aug 09, 2024 11:15 pm
My quest to make it work for any month will have to continue elsewhere as it is outwith the original parameters of my query.
If you make
August in A1 a
date intead of
text, Calc knows how many days are in that month. You can apply a style to the cell so it only shows the month name, or optionally the month and year. Formulas in A2:A32 can show only the days in that month. Create a new topic if you need help with that idea. I will not help unless you attach your spreadsheet. Read section
3. Dates in cells in
Ten concepts that every Calc user should know.
[Tutorial] Calc date formulas
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).