[Solved] Multiple IF() conditions?
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
[Solved] Multiple IF() conditions?
Hi,
I need help on multiple if conditions?
Please see the attached file.. I need hel p in AC column.. conditions are inside the file also..
Thanks...
I need help on multiple if conditions?
Please see the attached file.. I need hel p in AC column.. conditions are inside the file also..
Thanks...
- Attachments
-
- TEST1.ods
- (47.23 KiB) Downloaded 190 times
Last edited by jeandoll83 on Fri Sep 27, 2013 4:38 pm, edited 2 times in total.
openoffice.org 3.4.1
Re: help..Multiple if conditions?
I defined a few names and came out with this:
=OR(AND(vendor="JCI";mttr<=3);AND(vendor="MDS";mttr<=4);mttr<=defcds)
I'm not sure this is a good solution; I prefer to have such arbitrary logic expressed as a table, but I couldn't see a simple way to do that. Maybe someone else has a better approach?
Here's mine:
=OR(AND(vendor="JCI";mttr<=3);AND(vendor="MDS";mttr<=4);mttr<=defcds)
I'm not sure this is a good solution; I prefer to have such arbitrary logic expressed as a table, but I couldn't see a simple way to do that. Maybe someone else has a better approach?
Here's mine:
- Attachments
-
- TEST1_acknak.ods
- (49.07 KiB) Downloaded 230 times
AOO4/LO5 • Linux • Fedora 23
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
Re: help..Multiple if conditions?
sorry acknak why its not working for other cells..? i tried to change MDS to JCI on C17 and C18 but the AC column is still the same..? 
openoffice.org 3.4.1
- Hagar Delest
- Moderator
- Posts: 33614
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: help..Multiple if conditions?
Here is what I would put:
=OR(AND(vendor="JCI";mttr<=3);AND(vendor="MDS";mttr<=4);AND(vendor<>"JCI";vendor<>"MDS";OR(AND(crity="C1";mttr<=4);AND(crity="C2";mttr<=8);AND(crity="C3";mttr<=24))))
Please add [Solved] at the beginning of the title in your first post (top of the topic) with the edit button if your issue has been fixed.
=OR(AND(vendor="JCI";mttr<=3);AND(vendor="MDS";mttr<=4);AND(vendor<>"JCI";vendor<>"MDS";OR(AND(crity="C1";mttr<=4);AND(crity="C2";mttr<=8);AND(crity="C3";mttr<=24))))
Please add [Solved] at the beginning of the title in your first post (top of the topic) with the edit button if your issue has been fixed.
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
Re: help..Multiple if conditions?
Because my logic is wrong. The formula I gave accepts the default case where it should only check the special vendor.jeandoll83 wrote:sorry acknak why its not working for other cells..? ...
Better go with Hagar's idea.
AOO4/LO5 • Linux • Fedora 23
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
Re: Multiple IF() conditions?
hi guys!
Hi guys thanks alot.. its working...
Just one more thing..? Im wondering why i cant see the "yes" and "no" use in the formula..?
Can you explain...? so that next time I know how to do the same..? and change the result from yes to other words?
Thanks again...
Hi guys thanks alot.. its working...
Just one more thing..? Im wondering why i cant see the "yes" and "no" use in the formula..?
Can you explain...? so that next time I know how to do the same..? and change the result from yes to other words?
Thanks again...
openoffice.org 3.4.1
Re: Multiple IF() conditions?
I prefer to avoid building formulas around text; numbers, or text that appears in a cell, are more robust. So the formula I suggested produces only numbers: 1 for "yes" and 0 for "no".jeandoll83 wrote:... why i cant see the "yes" and "no" use in the formula..? ...
The text results you see on the screen are provided by the number format for those cells.
That means you can do calculations with those cells, if needed.
In your case, that may be over-complicated; you can skip it you like, just replace the ones and zeros in the formula by "YES" and "NO" or whatever.
AOO4/LO5 • Linux • Fedora 23
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
Re: Multiple IF() conditions?
openoffice.org 3.4.1
Re: Multiple IF() conditions?
Format>Cells... tab "Numbers"
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Multiple IF() conditions?
Just for fun, here's a version that works off of a table. The advantage of using a table is that you don't have to tweak a bunch of formulas if you need to change the rules, you just change the table. Also, you can easily see exactly what the rules and limits are.
The downside is that it's somewhat more complex and Calc still seems to have problems keeping all the named expressions straight: it doesn't seem to update everything correctly in some cases. A save/re-load seems to fix it.
@jeandoll83: if you find all this confusing, just ask for help, or just ignore it. Better to stick with what you understand.
The downside is that it's somewhat more complex and Calc still seems to have problems keeping all the named expressions straight: it doesn't seem to update everything correctly in some cases. A save/re-load seems to fix it.
@jeandoll83: if you find all this confusing, just ask for help, or just ignore it. Better to stick with what you understand.
- Attachments
-
- TEST1_acknak_table.ods
- (25.09 KiB) Downloaded 136 times
AOO4/LO5 • Linux • Fedora 23
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
Re: Multiple IF() conditions?
Thanks a lot guys...
but i have another concern? how will i incorporate blank cells in the formula..? and the result would either be "yes", "no" or "-"
please see attached file... both sheets..
thanks a lot..
but i have another concern? how will i incorporate blank cells in the formula..? and the result would either be "yes", "no" or "-"
please see attached file... both sheets..
thanks a lot..
- Attachments
-
- TEST2.ods
- (50.64 KiB) Downloaded 110 times
openoffice.org 3.4.1
Re: Multiple IF() conditions?
Try this: PM.I17 =IF(AND(E17="";C17="");"---";IF(E17<=C17;"YES";"NO"))
thinman3
thinman3
3.4.1 & 4.1.5 on MS Windows 7 Pro x64
-
jeandoll83
- Posts: 23
- Joined: Thu Aug 22, 2013 1:50 pm
Re: [Solved] Multiple IF() conditions?
thanks thinman3..it worked for the second sheet... for the first sheet i need also...for the formula by Hagar Delest .. i need to add another result if cells are blank then " - " should be the result.. i would then have 3 results for the formula which are yes, no and - (or blank)
openoffice.org 3.4.1
Re: [Solved] Multiple IF() conditions?
Enter the formula below in C22 of Sheet 1 and then fill up & down......
=IF(C22="";"---";IF(OR(AND(vendor="JCI";mttr<=3);AND(vendor<>"JCI";OR(AND(crity="C1";mttr<=4);AND(crity="C2";mttr<=8);AND(crity="C3";mttr<=24))))))
For the "---" , you can edit it to have fewer - 's if that is more to your needs. Making it to indicate C22 is blank, just use
;""; to replace the "---" in the above formula.
thinman3
=IF(C22="";"---";IF(OR(AND(vendor="JCI";mttr<=3);AND(vendor<>"JCI";OR(AND(crity="C1";mttr<=4);AND(crity="C2";mttr<=8);AND(crity="C3";mttr<=24))))))
For the "---" , you can edit it to have fewer - 's if that is more to your needs. Making it to indicate C22 is blank, just use
;""; to replace the "---" in the above formula.
thinman3
3.4.1 & 4.1.5 on MS Windows 7 Pro x64