Bug 106151 - Add a new CELL() function for Excel compatibility
Summary: Add a new CELL() function for Excel compatibility
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2017-02-23 10:07 UTC by GerardF
Modified: 2019-08-13 03:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description GerardF 2017-02-23 10:07:15 UTC
Help for CELL function in LibreOffice :
"Reference (list of options) is the position of the cell to be examined. If Reference is a range, the cell moves to the top left of the range. If Reference is missing, LibreOffice Calc uses the position of the cell in which this formula is located. Microsoft Excel uses the reference of the cell in which the cursor is positioned."

OASIS specification :
"R : if R is a reference to a cell, it is the cell whose information will be returned; if R is a reference to a range, the top-left cell in the range is the selected one; if R is omitted, the current cell is used."

My poor english does not allow me to know if the specifications are met.
What is the meaning of "Current cell"?
Cell where is the formula or active cell...

If we keep CELL how it works in LO and AOO, it should be good to have a new CELL.XL for compatibility.
Comment 1 m.a.riosv 2017-02-23 23:03:20 UTC
I think LibreOffice help information it's clear

https://help.libreoffice.org/index.php?title=Calc/Information_Functions&Language=en-US&System=WIN&Version=5.4#bm_id3159412
"
Reference (list of options) is the position of the cell to be examined. If Reference is a range, the cell moves to the top left of the range. If Reference is missing, LibreOffice Calc uses the position of the cell in which this formula is located. Microsoft Excel uses the reference of the cell in which the cursor is positioned.
"

BTW on the top it's possible select the language.
Comment 2 Carlos 2017-04-03 18:15:38 UTC
(In reply to m.a.riosv from comment #1)
> I think LibreOffice help information it's clear
> 
> https://help.libreoffice.org/index.php?title=Calc/
> Information_Functions&Language=en-US&System=WIN&Version=5.4#bm_id3159412
> "
> Reference (list of options) is the position of the cell to be examined. If
> Reference is a range, the cell moves to the top left of the range. If
> Reference is missing, LibreOffice Calc uses the position of the cell in
> which this formula is located. Microsoft Excel uses the reference of the
> cell in which the cursor is positioned.
> "
> 
> BTW on the top it's possible select the language.

LibreOffice help is clear. But GerardF is correct that the function is not 100% compatible with MS Excel. 

By the way the current MS Excel help 
http://web.archive.org/web/20170403173356/https://support.office.com/en-us/article/CELL-function-51BD39A5-F338-4DBE-A33F-955D67C2B2CF?ui=en-US&rs=en-US&ad=US
states that if the reference is missing, the CELL function uses the reference for "the last cell that was changed".
Comment 3 QA Administrators 2019-01-21 03:39:46 UTC Comment hidden (obsolete)
Comment 4 hardcoder 2019-08-12 15:07:35 UTC
In fact Excel help isn't precise about what happens when the second parameter isn't given. Despite not documented, Ms is aware of that behavior and didn't change it with time; instead, it was replicated in Excel Online and Excel Mobile (for Windows). Others are aware of the behavior too, besides LibreOffice Help. In WPS Office, CELL function works the same way.

Although I don't think this is the best place for such functionality, I'd be one more to ask for LibreOffice to implement it the way Excel did, as you didn't invent the function, and you support .xls and .xslx formats.

That feature can be useful for user interaction without requiring macros. (Functions are way more cross-platform and straightforward than macros in an additional language, which often defeats the purpose of choosing spreadsheet.) For example, the user can select a cell in a large table and get extra info about that value, or via conditional formatting, similar values can be highlighted (this works in Excel 2010 and Excel Online).
Comment 5 hardcoder 2019-08-12 15:19:19 UTC
That said, it would be even better to _also_ have a function just for returning the selected range reference -- and this time, it would expose the whole range, not just one cell. Also it would return the reference, like some other functions are able to use. (CELL, instead, can return the address only as a string, not directly as reference.)

Together with that, there could be per-file options on when to recalc, including when selection changes, and at fixed intervals. This last one already can be done by adding a dummy data connection ("link to external data..."). I guess it's better to leave this for a new bug report and replicate these suggestions there.
Comment 6 hardcoder 2019-08-13 03:19:53 UTC
(In reply to hardcoder from comment #4)
> [...] in Excel Online and Excel Mobile (for Windows).
(I have never used Excel for Mac or Android.)

> besides LibreOffice Help. In WPS Office, CELL function works the same way.
Works the same as MS Excel.

> Although I don't think this is the best place for such functionality, I'd be
> one more to ask for LibreOffice to implement it the way Excel did, as you
In my opinion, this behavior should be put in the very CELL function, not an additional one.