[Dropped] IFERROR formula from Excel

Discuss the spreadsheet application
Locked
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

[Dropped] IFERROR formula from Excel

Post by Mardana »

I have an Excel spreadsheet sent to me with the following formula in various cells. iferror(L18/L19;0) When I apply it to OO I get the following #NAME?
=if(iserror(SUMPRODUCT((((--TEXT($B5;"[mm]")<=--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]"))*(--TEXT($C5;"[mm]")>=--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]")))*($Data.$E$5:$E$2550<>""))*(Q$4=$Data.$I$5:$I$2550));SUMPRODUCT(((if(iserror((--TEXT($B5;"[mm]")<=--if(iserror(--TEXT(--MID($Data.$E$5:$E$2550;FIND(" ";$Data.$E$5:$E$2550)+1;LEN($Data.$E$5:$E$2550));"[mm]");0));0)*if(iserror((--TEXT($C5;"[mm]")>=--if(iserror(--TEXT(--MID($Data.$E$5:$E$2550;FIND(" ";$Data.$E$5:$E$2550)+1;LEN($Data.$E$5:$E$2550));"[mm]");0));0)*($Data.$E$5:$E$2550<>""))*(Q$4=$Data.$I$5:$I$2550)))). Can someone please advise the solution to how to fix this Excel formula to OpenOffice.
 Edit: Split from Add column to page 1 printout as this is a different question. 
Last edited by MrProgrammer on Sun Dec 15, 2024 10:09 pm, edited 2 times in total.
Reason: Dropped: No useful file attached; No response from Mardana
Open office 4.1.3
FJCC
Moderator
Posts: 9623
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Formula from Excel to OO

Post by FJCC »

Mardana wrote: Tue Oct 29, 2024 2:57 am iferror(L18/L19;0)
OpenOffice does not have the iferror() function. You can get the same result with

Code: Select all

=IF(ISERROR(L18/L19);0;L18/L19)
I can't make any sense out of the second formula you posted. Is that the complete formula?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
robleyd
Moderator
Posts: 5504
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Formula from Excel to OO

Post by robleyd »

OpenOffice Calc does not have the function IFERROR; you'll need to re-write the formulae to use IF() and ISERROR(). For instance

Code: Select all

=iferror(L18/L19;0)
would be rewritten as

Code: Select all

=IF(ISERROR(L18/L19);0;L18/L19)
Alternatively you may try LibreOffice which does have the IFERROR function.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
User avatar
keme
Volunteer
Posts: 3791
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Formula from Excel to OO

Post by keme »

There is a problem with your posted "monster formula" structure. It shows 40 "open parenthesis" and only 35 "close parenthesis", and all appear to be part of formula structure (none are quoted). This discrepancy may be caused by a limitation on formula length or nesting depth in your installed version of Calc, or in some other software your file has "visited", which "chopped off" the last part of the formula.

A few suggestions:
  • Can you explain what the formula is supposed to do? A different formula, hopefully also compatible with Excel, may then be devised.
  • Can you share the file, so we can observe the formula "live"?
  • Can you open the file in Excel and copy the offending formula from there?
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

Re: Formula from Excel to OO

Post by Mardana »

keme wrote: Tue Oct 29, 2024 11:44 am There is a problem with your posted "monster formula" structure. It shows 40 "open parenthesis" and only 35 "close parenthesis", and all appear to be part of formula structure (none are quoted). This discrepancy may be caused by a limitation on formula length or nesting depth in your installed version of Calc, or in some other software your file has "visited", which "chopped off" the last part of the formula.

A few suggestions:
  • Can you explain what the formula is supposed to do? A different formula, hopefully also compatible with Excel, may then be devised.
  • Can you share the file, so we can observe the formula "live"?
  • Can you open the file in Excel and copy the offending formula from there?
Attachments
TEST.ods
(54.22 KiB) Downloaded 92 times
Open office 4.1.3
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

Re: Formula from Excel to AOO

Post by Mardana »

We attached for the file as we provide from excel, when we operated in excel there is normal, when we open in OOc, the problem was, #name, after we changed every if error with If(iserror), the result is err:508
Open office 4.1.3
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

Re: Formula from Excel to AOO

Post by Mardana »

Actually the formula which we submit to excel as follow
=iferror(SUMPRODUCT((((--TEXT($B5;"[mm]")<=--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]"))*(--TEXT($C5;"[mm]")>=--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]")))*($Data.$E$5:$E$2550<>""))*(Q$4=$Data.$I$5:$I$2550));SUMPRODUCT(((iferror((--TEXT($B5;"[mm]")<=--iferror(--TEXT(--MID($Data.$E$5:$E$2550;FIND(" ";$Data.$E$5:$E$2550)+1;LEN($Data.$E$5:$E$2550));"[mm]");0));0)*iferror((--TEXT($C5;"[mm]")>=--iferror(--TEXT(--MID($Data.$E$5:$E$2550;FIND(" ";$Data.$E$5:$E$2550)+1;LEN($Data.$E$5:$E$2550));"[mm]");0));0)*($Data.$E$5:$E$2550<>""))*(Q$4=$Data.$I$5:$I$2550)))). And the result well done, but when we changed to OO, there is no result, and mismistake. I was follow for the instruction with another person, but the result still not matched.
Open office 4.1.3
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Formula from Excel to AOO

Post by Alex1 »

Function names displayed in lowercase are unknown to Calc. LibreOffice Calc does know IFERROR.
D5 contains =IF(Data.E5:E36 <>"", COUNTIFS(Data.E5:E36, ">=" & TIME(2, 0, 0), Data.E5:E36, "<=" & TIME(2, 59, 59), Data.G5:G36, "Airport"), "Data tidak valid")
It contains commas instead of semicolons as separators, which is wrong.
When I open it in Excel I see only a zero, not a formula. Something must have gone wrong with the conversion. Do you have the original XLSX version?
AOO 4.1.16 & LO 25.8.3 on Windows 10
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

Re: Formula from Excel to AOO

Post by Mardana »

hi Alex.
here with we attached the xlsx . Actually when we changed the profil and suburb they Will work
Open office 4.1.3
User avatar
robleyd
Moderator
Posts: 5504
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Formula from Excel to AOO

Post by robleyd »

File is not attached. See How to attach a document for details regarding attaching a document.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Mardana
Posts: 8
Joined: Fri Oct 25, 2024 3:38 am

Re: Formula from Excel to AOO

Post by Mardana »

robleyd wrote: Fri Nov 01, 2024 3:20 am File is not attached. See How to attach a document for details regarding attaching a document.
Here with we attach the file xlsx
Attachments
TEST.xls
(78 KiB) Downloaded 94 times
Open office 4.1.3
User avatar
Hagar Delest
Moderator
Posts: 33629
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Formula from Excel to AOO

Post by Hagar Delest »

Nothing useful it seems:
Calc_scrshot.png
Calc_scrshot.png (15.65 KiB) Viewed 2607 times
LibreOffice 25.2 on Linux Mint Debian Edition (LMDE 7 Gigi) and 25.2 portable on Windows 11.
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: Formula from Excel to AOO

Post by Alex1 »

This contains mostly errors, and I cannot find anything resembling the formulas you gave. Is this the wrong file?
AOO 4.1.16 & LO 25.8.3 on Windows 10
mikele
Posts: 73
Joined: Wed Nov 21, 2018 11:11 am
Location: Germany

Re: Formula from Excel to AOO

Post by mikele »

Hi,
instead of

Code: Select all

--TEXT($B5;"[mm]")
and

Code: Select all

--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]")
use

Code: Select all

MINUTE($B5)
and

Code: Select all

MINUTE($Data.$E$5:$E$2550)
LibreOffice 5.4, 7.0, 7.2 on LinuxMint/Win10
User avatar
karolus
Volunteer
Posts: 1243
Joined: Sat Jul 02, 2011 9:47 am

Re: Formula from Excel to AOO

Post by karolus »

mikele wrote: Sun Nov 03, 2024 4:41 pm Hi,
instead of

Code: Select all

--TEXT($B5;"[mm]")
and

Code: Select all

--TEXT(MOD($Data.$E$5:$E$2550;1);"[mm]")
use

Code: Select all

MINUTE($B5)
and

Code: Select all

MINUTE($Data.$E$5:$E$2550)
unfortunatly no, but:

Code: Select all

INT(MOD($B5;1)*1440)
and

Code: Select all

INT(MOD($Data.$E$5:$E$2550;1)*1440)
Libreoffice 25.2… on Debian 13 (trixie) (on RaspberryPI5)
Libreoffice 25.8… flatpak on Debian 13 (trixie) (on RaspberryPI5)
Locked