libreoffice-calc

Given an ISO 8601 week number, get date of first day of that week in LibreOffice Calc spreadsheet

被刻印的时光 ゝ 提交于 2020-01-24 08:47:08
问题 LibreOffice Calc spreadsheet offers a function ISOWEEKNUM to return the standard ISO 8601 week number of the specified date. I want the opposite. ➠ Given a standard week number, give me the date of the first day of that week (the Monday date). Passing integers is acceptable. Also nice if able to pass a string in standard format. Like this: DATE_OF_ISOWEEKNUM( 2017 , 42 ) ➝ date of Monday of week 42 in week-based year 2017 DATE_OF_ISOWEEKNUM( "2017-W42" ) ➝ date of Monday of week 42 in week

xlsxwriter and LibreOffice not showing formula's result

烈酒焚心 提交于 2020-01-11 04:45:28
问题 I'm trying to create an Excel file with a simple formula: import xlsxwriter workbook = xlsxwriter.Workbook('testxlsx.xlsx', {'strings_to_numbers': True}) ws = workbook.add_worksheet() ws.write('A2', 'Number one') ws.write('B2', '1') ws.write('A3', 'Number two') ws.write('B3', "1000") ws.write('A4', "Number three") ws.write('B4', "1050") ws.write('A5', "Number four") ws.write('B5', "3") ws.write('A6', "Result") ws.write('B6', '=IF(B5=3,ROUND(100-(B3/B4*100),1),ROUND(100-(B3/(B4*1.502)*100),1))

How to change a cell value periodically in libreoffice calc?

故事扮演 提交于 2020-01-07 04:43:05
问题 The title says it all... For example, if I want to have a cell which displays the current time and auto updates minute by minute (well, I think we call that a clock), how do I do it? Is there a simple function implemented already or should I create a macro and assign it to a specific event? EDIT: Following the provided answer by @Jim K, I want to be more clear about what I want. The "clock" example above was here to make it simple to understand, but what I really want is in the title: a cell

How to export cell range to PDF file?

本秂侑毒 提交于 2020-01-01 06:57:12
问题 I have following code to export a sheet to a PDF file: Option Explicit Sub exportToPdf Dim document As Object Dim dispatcher As Object document=ThisComponent.CurrentController.Frame dispatcher=createUnoService("com.sun.star.frame.DispatchHelper") Dim args1(1) as new com.sun.star.beans.PropertyValue args1(0).Name = "URL" args1(0).Value = "file:///home/someuser/Desktop/exported.pdf" args1(1).Name = "FilterName" args1(1).Value = "calc_pdf_Export" dispatcher.executeDispatch(document, ".uno

How to use LibreOffice functions into Basic?

て烟熏妆下的殇ゞ 提交于 2019-12-20 02:26:07
问题 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, 2, 3)) ' ---- Works OK Print aResult aResult = aFunc.callFunction("MDETERM", Array(2, 5, 8)) ' ---- IllegalArgumentException Print aResult oRange

How to scroll all sheets together (or other ~3D-like ideas)

雨燕双飞 提交于 2019-12-14 03:27:09
问题 I would like a "3D" spreadsheet, with the aim of having main entries in the normal 2D cells and then (potentially just-as-important) entries in a third dimension above each cell. This is what the multiple sheets already allow for, the problem is that I cannot easily see all the 3rd dimension cells at once. I was first hoping to find some sophisticated method of using actual 3D sheets but with no luck so far. I realised that if I could only make sure the other sheets would line up with my

How can I merge CSV rows that have the same value in the first cell?

别说谁变了你拦得住时间么 提交于 2019-12-13 09:46:27
问题 This is the file: https://drive.google.com/file/d/0B5v-nJeoVouHc25wTGdqaDV1WW8/view?usp=sharing As you can see, there are duplicates in the first column, but if I were to combine the duplicate rows, no data would get overridden in the other columns. Is there any way I can combine the rows with duplicate values in the first column? For example, turn "1,A,A,," and "1,,,T,T" into "1,A,A,T,T". 回答1: Plain Python: import csv reader = csv.Reader(open('combined.csv')) result = {} for row in reader:

Reading HTML page using Libreoffice Basic

血红的双手。 提交于 2019-12-13 08:38:47
问题 I'm new to LibreOffice Basic. I'm trying to write a macro in LibreOffice Calc that will read the name of a noble House of Westeros from a cell (e.g. Stark), and output the Words of that House by looking it up on the relevant page on A Wiki of Ice and Fire. It should work like this: Here is the pseudocode: Read HouseName from column A Open HtmlFile at "http://www.awoiaf.westeros.org/index.php/House_" & HouseName Iterate through HtmlFile to find line which begins "<table class="infobox infobox

How to extract data from one cell to another

假如想象 提交于 2019-12-12 20:39:01
问题 Given a spreadsheet cell containing a string that consists of a hyphenated series of character segments, I need to extract the fourth segment. For example, consider column A containing data strings like XX-XXX-X- G10 -XX-XXX, where X denotes any character. What formula would I need to place in column B to get G10 as a result? A B 1 XX-XXX-X-G10-XX-XXX G10 I'm looking for a formula that could work in in Libre Office Calc, Open Office Calc, MS Excel, or Google Sheets. 回答1: It was very simple...

How to export spreadsheet to CSV without evaluating formulas

北城余情 提交于 2019-12-12 18:17:50
问题 I'm looking for a way to export a spreadsheet (from MS Excel or LibreOffice Calc) without evaluating formulas so the formulas are stored in the CSV. I know, for example, I could convert formulas to text in MS Excel prior to export, but don't want to modify the formulas. It appears the default behavior for CSV export in MS Excel loses the formulas if they're not displayed as text. 回答1: First, select the tab with the formulas, then hold "Ctrl" + "~" (the tilde character), then do a File, Save