=On 6 Apr 2026 at 18:46, James wrote:
Date sent:60;Mon, 6 Apr 2026 18:46:39 -0400
Subject:;Re: [libreoffice-users] switch function in
calc
To:0;users@global.libreoffice.org
From:  James <bjlockie@lockie.ca>
Nice.
I googled it and found switch but ifs is the best
solution.
Thanks everyone.
On 2026-04-06 04:37, Regina Henschel wrote:
Hi James,
James schrieb am 06.04.2026 um 06:15:
A1 contains the number 14023.
B1 contains the formula
=SWITCH(AND(A1>5000,A1<15000),20%,A1>15000,30%)> >> B1 is showing 30% when I expected 20%.> >> What
am I doing wrong?
SWITCH is the wrong function. Use IFS instead.
=IFS(AND(A1>5000,A1<15000),20%,A1>15000,30%)> >
Kind regards,
Regina
Not clear on what you actually are trying to do??
Results from the formula have 3 options #N/A , 20% or 30%
Might be that value of A1 only falls into ranges that return 20% or
30%, but is an issue if it could be exactly 15000?
Looks fine when pasted. But shows on list weird. From Libre Calc
1500
#N/A</div>\u201c=IFS(AND(A3>5000,A3<15000),20%,A3>15000,30%)
\u201c<1500
15000
#N/A</div>\u201c=IFS(AND(A4>5000,A4<15000),20%,A4>15000,30%)
\u201c=15000
15001
0.3\u201c=IFS(AND(A5>5000,A5<15000),20%,A5>15000,30%)
\u201c>15000</span>
14999
0.2\u201c=IFS(AND(A6>5000,A6<15000),20%,A6>15000,30%)
Between 1501 and 14999
Pasted as text and reduced to 10pt
1500#N/A\u201c=IFS(AND(A3>5000,A3<15000),20%,A3>15000,30%)15000#N/A\u201c=IFS(AND(A4>5000,A4<15000),20%,A4>15000,30%)150010.3\u201c=IFS(AND(A5>5000,A5<15000),20%,A5>15000,30%)\u201c>15000
149990.2\u201c=IFS(AND(A6>5000,A6<15000),20%,A6>15000,30%)Between 1501 and
14999
--
To unsubscribe e-mail to:
users+unsubscribe@global.libreoffice.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more:
https://wiki.documentfoundation.org/Netiquette
List archive:
https://listarchives.libreoffice.org/global/users/
Privacy Policy:
https://www.documentfoundation.org/privacy
+------------------------------------------------------------+
Michael D. Setzer II - Computer Science Instructor (Retired)60;
mailto:mikes@guam.net 
mailto:msetzerii@gmail.com
mailto:msetzerii@gmx.com
Guam - Where America's Day Begins 
G4L Disk Imaging Project maintainer
http://sourceforge.net/projects/g4l/
+------------------------------------------------------------+
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.