LibreOffice hide #VALUE - libreoffice

Can someone tell me how to hide in the cell the #VALUE! with conditional formatting or somehow?
A1 - DATE | B1 number (for ex.60) | C1 - DATE
When A1 cell which is DATE contains data (for example 2019.03.20) and the
B1 is for example 60 than C1=2019.05.19
I think it is okay to add sixty days to cell A1
But by default the A1 is empty and in this case, the C1 shows this error: #VALUE!
My question is, how to hide the #VALUE! text?
Thank you!

In any situation where you need to catch problems and show something else instead, use IFERROR.
For example, set C1 to
=IFERROR(A1+B1,"Missing date or days")
or to have it be blank,
=IFERROR(A1+B1,"")

Related

Google Sheets conditional formatting with differently styled dates

in Google Sheets I'd like to format an area of cells automatically by comparing its date value to another cell. In fact, I have some cells representing a month (the area of cells to be formatted) and a single cell with another date (05.05.2022 formatted as 05.05. see screenshot).
So date for homework is located in U6 and cell area for moth of may is K11:Q16. When I set conditional formatting to
apply to range: K11:Q16
and
Date is: exact date: =U6 or custom formula is: =U6
it does not work. But when I set range to N12 (05.05.2022 formatted as 5) it does work.
Any ideas?
Thanks in advance.
edit:
I created a separate sheet for sharing, so this does not fit to the screenshot:
https://docs.google.com/spreadsheets/d/1gBx3dbzxk3Qb999uo3YMdz0A9-ViSE4xPeihhasN7FQ/edit?usp=sharing
try like this:
=COUNTIF($I$2:$I$5; D11)
or:
=MATCH(D11; $I$2:$I$5; )

Auto select an option from a dropdown after a certain date

I'm creating a lost&found log for work, I have a dropdown list with options like "Collected", "Sent to guest", "Donated" etc.
I'd like to have the sheet automatically select 'Donated' after a certain date (maybe after 1 month) IF an option hasn't already been selected.
E.G. If somebody inputs a found pair of gloves on Nov 2nd, The empty dropdown will automatically change to 'Donated' on Dec 2nd unless somebody already selected another option (E.G. 'Collected').
You can accomplish this by either making use of Apps Script to check the conditions and make the corresponding changes or by directly implementing Sheets functions.
Sheets Functions
You can achieve the desired outcome by putting this formula on each status cell:
=IF(TODAY()-D4>30,"Donated","")
It will work as intended, the cell will not display anything until there are 30 days between the TODAY() date and the date provided in the D4 cell. If there are, the cell will display Donated. If another option from the drop-down is selected, that will erase the formula and only the new value will be displayed.
However, this method is more of a quick hack than an actual robust solution, as several things can go wrong. For instance, if an option from the drop-down is chosen by accident and then it is left blank again, the method will not work anymore for that line as the formula will have been permanently erased.
You can read about how TODAY() works here.
Apps Script (recommended)
The following script will check that, for every row in the sheet, both the status cell is blank and that subtracting the DATE FOUND is more than 30 days (unfortunately that has to be done in milliseconds).
function myFunction() {
var spreadSheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadSheet.getSheetByName("Sheet1");
sheet.getLastRow()
var range = sheet.getRange(4,1,sheet.getLastRow(), 7);
//SELECT A RANGE WITH THE 7TH FIRST COLUMNS AND AS MANY ROWS AS NECESSARY
//(WE ARE INTERESTED IN DATA STARTING FROM ROW 4TH)
var values = range.getValues();
var millisecondsIn30Days = 30 * 24 * 60 * 60 * 1000;
for(var row = 0; row<values.length; row++){
var status = values[row][6]; //STATUS IS THE 6TH ELEMENT IN THE ROW ARRAY (COLUMN G)
if(status == "" && (new Date() - values[row][3]) > millisecondsIn30Days){
//MORE THAN 30 DAYS AFTER FOUND
sheet.getRange(row+4,7).setValue("DONATED");
}
}
}
Of course, that script can be run manually or the job can be automated with an installable trigger that runs, for example, every month. You can read more about how to set up such triggers here.

How to auto-fill the row's column based on the row above?

I have a Google sheet where the 1st row is the date and it will autofill every day. So does the row "Value 1" & "Value 2". Now, I've added manually a row name "SUM" with sum formula.
My question is, how can the row be automated every day so that I do not need to manually drag the formula to the right?
Here's the example sheet:-
https://docs.google.com/spreadsheets/d/1gkKn-tDxosXQGvOdYMj8CupEdG9YXi4sB8PegojDS58/edit?usp=sharing
paste in B1 cell:
=ARRAYFORMULA(TRANSPOSE(TEXT(ROW(INDIRECT("A"&
DATEVALUE("2019-9-1")&":A"&
DATEVALUE(TODAY()))), "d/m/yy")))
paste in B4 cell:
=ARRAYFORMULA(MMULT(TRANSPOSE(ROW(
INDIRECT(ADDRESS(2, 2)&":"&ADDRESS(ROW()-1, MAX(IF(1:1<>"", COLUMN(1:1), ))))))^0,
INDIRECT(ADDRESS(2, 2)&":"&ADDRESS(ROW()-1, MAX(IF(1:1<>"", COLUMN(1:1), ))))))

How to replace crosstab cell's value with a string

I have column fact, it can carry some difference values:
- Positive values - real values, need to be outputted as is
- 0 is null, output as is
- -1 - special value. Need to ouput "VAC" string in cell.
- -2 - special value. Need to output "SICK" string in cell.
I tried to do it with editing dimension, i replace it with:
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC'
when [BaseEmp].[FACT_VALUE] = -2 then 'SICK'
else to_char([BaseEmp].[FACT_VALUE])
end
But now I see error: ORA-01722 invalid number (i think, because strings cannot be aggregated). In column properties I select "min" as aggregate function.
How to replace my special values with strings?
You don't need to change value to VAC, SICK etc.
You need to change DISPLAYED value.
Unlock the padlock in RS.
Select text in your cell
Set text source to "Report Expression"
Write expression like
CASE
WHEN cellValue() = -1 THEN 'VAC'
WHEN cellValue() = -2 THEN 'SICK'
WHEN cellValue() = 0 THEN ''
ELSE cellValue()
END
I tried thinking of a work around regarding your problem. I'm not really sure what you crosstab looks like but considering your parameters above, try creating a data item which holds your case condition for your fact.
Ex.
case
when [BaseEmp].[FACT_VALUE] = -1 then 'VAC' <--- this will produce Any Error Characters
when [BaseEmp].[FACT_VALUE] = -2 then to_char([BaseEmp].[FACT_VALUE]/0) <--- this will produce Missing Value Characters
else to_char([BaseEmp].[FACT_VALUE]) <---- as is
end
Then set the data item's Data Format to number and set the values for the properties as follows:
Kindly give this a try and hopefully it can somehow resolve you problem. Cheers!
Nikita Kuhta checkout Alexey's Baturin's answer. I think it's the appropriate approach. Just one thing if you unlock and select the text in the cell, all of the cell values will be selected and affected by the report expression. You might have several columns or other fact items in the crosstab. If that's the case, what you can do is
Unlock the Report.
Select the crosstab cell/intersection you want to change.
Set the Define Content to Yes.
Drag a Layout Calculation in the crosstab cell/intersection, then insert your case statement.
Thanks to a friend who told be about the define contents. :D

Looking to show date that a cell is updated

I'm looking for a way to display the date that a cell was modified, in another cell. For example:
if I make a change to A1 on the 1st of January then A2 would show 01/01/2014.
I would also like to know how to have a cell which displays the date something was modified, but only if in a certain way. For example:
only when A1 is changed to read yes then A2 shows that change.
You can use a formula, put in A2:
=IF(A1<>"";IF(A2<>"";A2;NOW());"")
This will
only do something, if A1 is filled,
check if A2 is already filled... then leave it
else insert a timestamp
For your second question - just add the condition:
=IF(A1="yes";IF(A2<>"";A2;NOW());"")
edit: This will work for OpenOffice (Apache, LibreOffice, .org), if you switch on "iterative references" [Tools...>Options...>Calc>Calculate]