Date: prev next · Thread: first prev next last


2016-06-21 16:07 GMT+02:00 Jan Öhman <Jan_Ohman@glocalnet.net>:

Hej!
Antag att jag har ett datum "2016-11-30" i en cell (B2)

I Cell B3 ska datumet vara 3 dagar senare (inget problem med formeln =B2+3)

Men om jag vill addera 3 månader till B2 (i C4) - Hur gör man och vad blir
resultatet?


Nu fick du allt något att bita i…

Tricket är att dela upp datumet i år, månad och dag. Det finns en funktion
som heter DATUM(År,Månad,Dag). Använd den.

=DATUM(ÅR(B2),MÅNAD(B2)+3,DAG(B2))

Om B2=2016-03-31, skulle vi nu få 2016-06-31, men eftersom juni bara har 30
dagar får vi istället som svar 2016-07-01 istället. Detta borde vara det de
flesta vill ha (första juli är ju faktiskt samma sak som trettioförsta
juni), annars får du nog göra din egen funktion. Det jobbigaste blir nog om
du exempelvis lägger på två månader på 2016-12-31, då du får 2017-03-03
eftersom februari 2017 bara har 28 dagar.



Vänliga hälsningar

Johnny Rosenberg




//Jan


--
For unsubscribe instructions e-mail to:
users+unsubscribe@sv.libreoffice.org
Problems?
http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/sv/users/
All messages sent to this list will be publicly archived and cannot be
deleted



-- 
For unsubscribe instructions e-mail to: users+unsubscribe@sv.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/sv/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.