Extracting numbers or dates from cell using formula; works in Excel, but not in LibreOffice

LibreOffice Calc stinks when it comes to extracting dates or numbers out of General text; no problem in Excel, but I have tried everything from re-formatting input cell to re-formatting output cell with formula. Any help would be most appreciative. I have already submitted this, so the word “stinks” was added here out of irritation for not receiving a response. I have followed many instructions about this and none of the instructions to correct this work at all. I am getting rather irritated. Also, formatting dates and numbers and having Calc remember the settings is a real “bear,” compared to Excel.

Doug Cornwell
email: bibsinger(at)gmail-com

Edited by @Ratslinger

I use Excel and Calc all the time and don’t see any significant differences in this aspect. Perhaps it would be better to understand with specific examples.

1 Like

Not here, or not with the actual user name. So, please, edit your question, and use proper language. Thanks.

1 Like

Then where did I submit it? If it is this difficult to submit, then why?

My specific examples were provided in what I submitted. Where are they? Again. Why is it so difficult to submit?

Specific examples.

  1. Number extraction

Cell A1: 06/04 Purchase $265.69 Cash Back $40.00
[total amount of transaction is $$305.69]

Cell B1 formula: +RIGHT(A1,6) … RESULT: $40.00, even when formula result cell formatted for… $ 40.00 … [or negative of $ (40.00)… number format…

[>0]" $"* #,##0.00" “;[<0]” $"* (#,##0.00);" $"* -#" “;” “@” "

This format works for me, but not when using the result value from the formula in cell B1.

With the formula result of $40.00 (value not formula), other formulas are not always able to recognize this number. Other numbers using the format above do come out, when I type a number, as $ 40.00 …
With the value which comes from the formula result and using the same format, I get $40.00 and difficulty recognizing this as a number. Why?

[NOTE: have tried both (A1,6) or (A1,5) and get same result with each]

  1. Date extraction

Cell A1: 06/04 Purchase $265.69 Cash Back $40.00
[total amount of transaction is $$305.69]

The date in A1 is without the year. It is current year. In Excel, have been able to extract full date, 06/04/2022. In LibreOffice Calc, I began with what I once used in Excel. It did not work. Have spent hours and hours trying to find a formula in Calc which will work. Why?

NOTE: I used the word, “stinks,” not the “" word. The word “stink” is commonly used, so I don’t need to be told NOT to use it, unless we are all of purity. I try to avoid the "” word as much as possible. As I explained in my message, I used the word, “stink,” because of the hours and hours I have spent trying to figure this thing out and am still coming up empty-handed with all the solutions tried, never receiving a reply back when I inquired, and becoming irritated at what ever has happened to make these further problems happen to me. Don’t know what is happening that someone would want to put a word I used before helping me solve my problem. My initial requests were being kind and with inquiry. Please reply to me and be kind to me. You need to attempt to understand my situation, all the way around.

Douglas Cornwell
bibsinger(at)gmail-com

Edited by @Ratslinger - Common is not an excuse. This site is used by peoples of various ages and backgrounds. Please refrain from inappropriate language. Thank You.

My user name is cornweld

You can upload a file in .xlsx format (the up arrow button when creating / editing a message), we will open this file in Excel and Calc and compare the results.

1 Like

Hi cornweld,
here are the solution to your examples:

=NUMBERVALUE(RIGHT(A1,5),".")

resp.

=DATE(2022,MID(A1,4,2),LEFT(A1,2))

I hope this helps you.
Here is also my example file:

Extracting Numbers.ods (15,0 KB)

Once you have successfully exported your numbers from the text, you can use the number format to put them in any format you want.

Kind regards
Jürgen

1 Like

Many thanks, Jurgen. Mucho gracias, Jurgen.

I never heard of NUMBERVALUE in Excel because I did not have to use it to get these same results, when using Excel.

As for the DATE function, still do not understand why I was doing practically the same thing and getting errors. Who cares, though?

I take it you are using the European date format (dd/mm/yyyy) because your formula gave the day before the month. I was able to adjust for the mm/dd/yyyy format, so no problem. We who are genealogists in the USA use that European format, but in all other areas in the USA, particularly in finance, it is always mm/dd/yyyy. As I said, no problem, as I was able to adjust.

You did help me out very well and I wish to extend a thanks once again.

cornweld

Neither Excel 2010 nor LibreOffice Calc create numbers or dates with the formulas originally exampled as not working. Adding Value() works for both programs, although formatting is required.

=VALUE(RIGHT(A1,6)) and format as currency
&
=VALUE(LEFT(A1,5)) and format as Date

1 Like

Note that VALUE() evaluates according to the current locale, if data doesn’t match that it may yield unexpected results if not error.

1 Like