libreoffice-calc , Date calculation in Libre Office


Date calculation in Libre Office

Question:

Tag: libreoffice-calc

I am using Libre Office 4.2 on ubuntu. I am not an expert in setting up formulae. My question is as follows.

I have dates in one column. I want the column next to it to show the number of days that have passed since the date in the previous column. For ex. For today, i.e. 25th of Feb, If column A has 21st of feb, B should read 4 days.

A                  B
21 Feb 2015      4 days

Is this possible at all? Thanks in advance :)


Answer:

Just subtract, it will give you the number of days.

=A2-A1

If A2 was 25 Feb and A1 was 21 Feb, the result will be 4.


Related:


Date calculation in Libre Office


libreoffice-calc
I am using Libre Office 4.2 on ubuntu. I am not an expert in setting up formulae. My question is as follows. I have dates in one column. I want the column next to it to show the number of days that have passed since the date in the previous...

How to use LibreOffice functions into Basic?


libreoffice,basic,libreoffice-calc,libreoffice-basic
I've asked here about the good way to do so. Now I'm trying the following code found here, and get some unexpected errors. I suppose I'm not using it the correct way. Any idea ? Sub Main Dim aResult Dim aFunc Dim oRange aFunc = GetProcessServiceManager().createInstance("com.sun.star.sheet.FunctionAccess") aResult = aFunc.callFunction("SUM", Array(1,...

Libre Calc - Setting cell with a formula


libreoffice,libreoffice-calc,calc,libreoffice-base,libreoffice-basic
In Libre Calc i am trying to set a field to a color depending on what number is entered in the field. the column C needs to be the color Red if it is 25% or less of Column B. Column C also needs to be the color green when...

LibreOffice formula - find from list and sum the quantity


libreoffice-calc
I have a spredsheet that holds in first colum Part Number and in the second price in $ for this PN( and some other details). The list is aprox 100.000 items long. Sometimes I get a from the customer a query about the total price for eg. 500 item, some...

OpenOffice Calc displays only 9 numbers after decimal points, how to show more


formatting,openoffice-calc,formulas,libreoffice-calc
I am in a situation of dealing with numbers when there is need to display the numbers as is on the excel sheet. Currently 37.6172080480001 is being displayed as 37.617208048 Seems like the sheet by default only displays 9 digits after the decimal points. How can that be updated to...

LibreOffice Calc macro - How to remove header and footer in given sheet?


libreoffice,libreoffice-calc,libreoffice-basic
Default header and footer show up when I print out invoice created by macro. I want to remove them in my macro.

OpenOffice Calc: SUM(IF()) not working


openoffice-calc,libreoffice-calc
I want to calculate the sum of a column but only if the value of another column on that row has a certain value: --------- | A | 1 | | A | 2 | | B | 5 | --------- This should yield: A=3 and B=5. After some attempts,...

Parametrized Conditional formatting in Calc


function,conditional-formatting,libreoffice-calc
I am trying to dynamically set the Style of a row in Calc. After giving up using a macro (see Changing cell background color in LibreOffice), I tried with Conditional Formatting rules (Format --> Conditional Formatting). I would like to set a parametrized Range, so that the conditional formula is...