Nested IF malfunction when used with WEEKDAY function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gnumeric (Ubuntu) |
Opinion
|
Undecided
|
Unassigned | ||
libreoffice (Ubuntu) |
Opinion
|
Undecided
|
Unassigned | ||
openoffice.org (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: openoffice.org
The following Calc formula appears to have malfunctioned.
=IF(WEEKDAY(
I shall refer to this formula as the Saturday Formula.
What is expected to happen:
The formula should return the name of the day corresponding with the results of the WEEKDAY function applied to Cell B24. So if B24 has the date "3 Oct 2010", the WEEKDAY (applied using the Type value 2) function will return the value 7 and the formula will display the value "Sunday".
The IF function has been nested with each day of the week, so that if the first weekday value is not found, it looks for the second and so on until it has checked for all seven days of the week. If none of the days of the week are found (if, for example, Cell B24 is blank), then it should display the value "...".
What actually happens:
The formula displays the correct day for every day of the week. But if Cell B24 does not contain a date (for example, if it is blank) it displays the word "Saturday".
Further explanation:
The same problem does not occur if the "IF(WEEKDAY..." function is nested only 5 times. So the following formula, which I shall refer to as the Friday Formula, works correctly:
=IF(WEEKDAY(
The Friday Formula correctly displays "..." if none of its nested IF functions are satisfied. The only significant difference it has to the Saturday Formula is one less IF function.
I was unable to repeat the malfunction by nesting a plain IF, nor by nesting an IF using the DAY function. So the following formula, which contains the same number of IF's as the Saturday formula, correctly delivers "..." if none of its IF functions are satisfied.
=IF(B1=
(Reffering to Cell B1 in this formula for no other reason than this is where it was looking for a date).
The following formula, which also has the same number of IFs as the Saturday Formula, also correctly delivers "..." if none of its nested IFs are satisfied:
=IF(DAY(
Note that its use of the DAY function seems to indicate that the problem is related to the nesting of the WEEKDAY function.
ProblemType: Bug
Architecture: i386
Date: Sun Oct 3 16:42:01 2010
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: openoffice.org-core 1:3.1.1-5ubuntu1.2
ProcEnviron:
PATH=(custom, no user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: openoffice.org
Uname: Linux 2.6.31-22-generic i686
Changed in openoffice.org (Ubuntu): | |
status: | Opinion → Won't Fix |
markling, thank you for reporting this bug and helping make Ubuntu better. Could you please attach the file that demonstrates this problem?