[Solved] IF function result differs from Excel

Discuss the spreadsheet application
Locked
Oskar4U
Posts: 98
Joined: Thu Mar 18, 2021 1:30 am
Location: Quebec, Canada

[Solved] IF function result differs from Excel

Post by Oskar4U »

I have copied an Excel table to LibreOffice Calc 7.6.5.2 (x86_64) and I get incorrect results in a column where I have this function

=IF(F53=0,G52+E53,G52+F53)

Some times the results are correct and some times the results are not correct so I try to find out where the mistake is.

Since the function was copied from Excel I wonder if this functions syntax is correct or needs to be modified.

Thank you
Last edited by Oskar4U on Mon Feb 24, 2025 3:30 am, edited 2 times in total.
Nicolas
LibreOffice 7.5.4.2 in Windows11
User avatar
RoryOF
Moderator
Posts: 35234
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Using Excel Functions

Post by RoryOF »

Turn on /View /Value highlighting, and check the data types of the cells involved.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Oskar4U
Posts: 98
Joined: Thu Mar 18, 2021 1:30 am
Location: Quebec, Canada

Re: Using Excel Functions

Post by Oskar4U »

Thank you for your time RoryOF

I did what you described and noticed the data related to the function are all highlighted. So I assume the syntax of the function is correct.

Much appreciated
Nicolas
LibreOffice 7.5.4.2 in Windows11
User avatar
floris v
Volunteer
Posts: 4642
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: IF function result differs from Excel

Post by floris v »

Oskar4U wrote: Some times the results are correct and some times the results are not correct so I try to find out where the mistake is.
That's rather vague. Can you be more explicit? How are the results not correct?
The syntax is not strictly correct. Calc uses a semicolon (;) instead of a comma to separate parameters in functions, but LibreOffice seems to be forgiving with that, dependent on the settings in Tools - Options - Calc - Formula.
LibreOffice 25.8.4.2 on Ubuntu Linux
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
Alex1
Volunteer
Posts: 852
Joined: Fri Feb 26, 2010 1:00 pm
Location: Netherlands, EU

Re: IF function result differs from Excel

Post by Alex1 »

Is the value in F53 the result of a calculation? Check if it's really zero by displaying more decimals.
AOO 4.1.16 & LO 25.8.3 on Windows 10
Oskar4U
Posts: 98
Joined: Thu Mar 18, 2021 1:30 am
Location: Quebec, Canada

Re: IF function result differs from Excel

Post by Oskar4U »

Sorry for the confusion, it is an accounting table for my yearly expenses:

G is the column where the final results is shown.
So if column F contains 0 it adds column E number to column G,
other wise it adds to column G what is in column F

=IF(F54=0,G53+E54,G53+F54)

The results are not correct because column G does not contain always the correct value

In Excel I used to copy the function from row 0 to row 500 and Excel used to change automatically the row numbers. I do not know if LibreOffice does the same.

As I mentioned perhaps I make a mistake and thinking the values are not correct so I went back to Excel. Now I will go back to LibreOffice and pay more attention to see what happens.

I was not aware of the settings in Tools - Options - Cal - Formula, now I will verify and make changes as needed

Many thanks for your time
Nicolas
LibreOffice 7.5.4.2 in Windows11
User avatar
Zizi64
Volunteer
Posts: 11507
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: [Solved] IF function result differs from Excel

Post by Zizi64 »

=IF(F53=0,G52+E53,G52+F53)
The default formula separator character is the ";" (semicolon) in the OpenOffice and LibreOffice. The "," (comma) character is the decimal separator in many languages (locales). And the AOO and LO are multilanguage softwares. Use the semicolon. (Maybe that is not the root of your problen, but it is better to use the office suite in the regular way.)
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Oskar4U
Posts: 98
Joined: Thu Mar 18, 2021 1:30 am
Location: Quebec, Canada

Re: [Solved] IF function result differs from Excel

Post by Oskar4U »

Thanks but using the semicolon I get ERROR, so I went back to comma
Much appreciated
Nicolas
LibreOffice 7.5.4.2 in Windows11
Locked