S
S
Sergey c0re2020-03-24 19:09:17
excel
Sergey c0re, 2020-03-24 19:09:17

Is it possible to somehow process the result of the function = #VALUE!?

What is the point, in some rows of the column with dates, when filling in manually, operators naturally make mistakes and where they have month 22, where values ​​are separated by commas, etc. etc.
I need to extract data from these cells for loading, and of course, if the format is incorrect, the MONTH(F425) function will return #VALUE!

there is conditional formatting in LibreOffice, while I set up the check of the cell is not empty and so that the total length of the text in it is = 8 for the full date, I would write a regular expression, it seems possible (I haven’t figured it out just yet), but I’m not sure that Excel will understand it, because what Excel operators have
The meaning of conditional formatting, if the content of the cell is not correct (determined by the form in conditional formatting), then the cell is highlighted with a red background. And it seems to work in Excel as well.
But it turns out that the condition "so that the total length of the text in it is = 8" is too small, because more mistakes.

I thought to try to extract the date from the cell with conditional formatting and if it doesn't work then highlight it, but how? if the function returns #VALUE! , then the whole construction of the formula breaks down.

PS: the problem is that I have LibreOffice and Excel operators are motley, starting with Excel 2003

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey c0re, 2020-03-24
@erge

Already done using IFERROR:
=IFERROR(IF(DAY(A1)>0;0;1);1)
i.e. if not date then 1 is returned, if date then 0
is for conditional formatting.
PS: in LibreOffice, for example, there is no EAT, etc., but there is an ESLIO.
there is also validation of the content in the cell (Data -> Validation) in LibreOffice, a message appears - "invalid value"
but I don’t know if it will work in Excel if saved from LibreOffice, formulas in conditional formatting work.
UPDATE:
There is no IFERROR function in Excel 2003 (file opens as corrupted, conditional formatting "flies"),
=IF(ISERROR(DAY(F2));1;0)
to highlight empty cells, dates with incomplete years, incorrectly entered dates - like this:
=OR(LENGTH(F2)<>10; IF(ISERROR(DAY(F2) );1;0) )

S
Shohruh Shaimardonov, 2020-03-24
@joeberetta

Before catching an error, try to make sure that these errors do not exist (and if this is not possible, then only catch errors).
Here is a tutorial to write a cell validator for the correct date: https ://www.contextures.com/exceldatavalidationdat...
I also advise you to insert a date picker (there are ready-made forms with macros on the network) to select a date from the existing "pop-up calendar". So simplify the task not only for yourself, but also for users

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question