spreadsheet

Excel - Split by `;` in each cell

 ̄綄美尐妖づ 提交于 2019-12-02 07:54:48
I would like to split these texts into cells in excel: Hello-HOW-are-YOU-DOING-! This-is-not-my-name-. Random-People-are-looking-? No-! It should basically look like that: At the moment I am using this formula, which gives me just the first split: =LEFT(Export!A2;FIND("-";Export!A2)-1) Any recommendations how I can do the split automatically for each - ? I appreciate your replies! With data in B1; in C1 enter: =TRIM(MID(SUBSTITUTE($B1,"-",REPT(" ",999)),COLUMNS($A:A)*999-998,999)) and copy across: Or you could do this... =MID($A2,FIND(B2,$A2)+LEN(B2)+1,FIND("-",$A2,FIND(B2,$A2)+LEN(B2)+1)-

Google Scripts Returning Not a Number

▼魔方 西西 提交于 2019-12-02 05:08:48
I've been working on Google Scripts for a bit, but I can't seem to find the solution to my problem. What I am trying to do is multiply the contents of two cells on a spreadsheet together with my function calculateRates() . Here is my code: /** @customFunction */ function calculateRates(hourDecimal, personRate) { var ss = SpreadsheetApp.getActiveSpreadsheet(); //Access spreadsheet var sheet = ss.getSheets()[0]; //Access sheet var range = sheet.getDataRange(); //Access all cells var values = range.getValues(); //Call to get value of certain cell var totalEarned = hourDecimal * personRate; Logger

Using open XML to create excel file

时光总嘲笑我的痴心妄想 提交于 2019-12-02 04:47:43
问题 I am trying to use Open XML to create a file but when trying to add just the first row of headers the file is being corrupted and I am unable to open, can anyone tell me what I am doing wrong here? using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create("C:\\testpdfs\\mytest.xlsx", SpreadsheetDocumentType.Workbook)) { // Add a WorkbookPart to the document. WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart(); workbookpart.Workbook = new Workbook(); // Add a

Call VBA function that returns custom type from spreadsheet

风流意气都作罢 提交于 2019-12-01 23:39:07
I have a vba function that returns a custom data type, defined as: Public Type stockValue stock As String value As Double End Type My question is how do I deal with this when i call the function from a spreadsheet cell ? for example, say i want the cell do display the stock value, i tried =function().stock and it doesn't work any help is appreciated, thanks ! Function getLowestPnl(strat As String, rank As Integer) As stockValue Call Conecta_DB(conexao) Set registros = New ADODB.Recordset strSQL = "SELECT stock,sum([value]) FROM Reports.dbo.Entry WHERE idStrategy='" & strat & "' and idType=1

Changing cell background color in LibreOffice

核能气质少年 提交于 2019-12-01 22:23:22
问题 I am using LibreOffice 3.5.4.2. I would like to change the background color of cells based on various conditions. As a minimal example, I have the following macro/function defined: function bgcolor() Dim Doc As Object Dim Sheet As Object Dim Cell As Object Doc = ThisComponent Sheet = Doc.Sheets(1) Cell = Sheet.getCellByPosition(0, 0) REM Cell.CellBackColor = RGB(50,60,70) bgcolor=Cell.CellBackColor end function I execute the function by entering =BGCOLOR() into a cell. The cell in which that

How to compare strings in google apps script

白昼怎懂夜的黑 提交于 2019-12-01 21:13:56
问题 I am trying to compare string values that I have obtained from my google spreadsheet. My Months appear in this format " Jun13", "Aug13" etc. and my script has trouble comparing the values when they are in such formats var data = ss.getRange(2,2,ss.getLastRow(),3).getValues(); var ListOfMonths = new Array(); for(var i = 0; i < data.length; ++i){ var row = data[i][0]; var duplicate = false; for(j in ListOfMonths){ if(row.toString.match(ListOfMonths[j][0])){ duplicate = true; } if(!duplicate){

ruby spreadsheet row background color

℡╲_俬逩灬. 提交于 2019-12-01 17:50:38
I am trying to parse an excel spreadsheet using "spreadsheet". How could I get the background color of each row? book = Spreadsheet::Workbook.new sheet = book.create_worksheet :name => 'Name' format = Spreadsheet::Format.new :color=> :blue, :pattern_fg_color => :yellow, :pattern => 1 sheet.row(0).set_format(0, format) #for first cell in first row or sheet.row(0).default_format = format #for entire first row you can iterate over each row/cell and apply style exactly where you want I was looking around for colors that you can use for the background color of a cell. For example: Spreadsheet:

Google Spreadsheets script to delete any rows where a string is found

匆匆过客 提交于 2019-12-01 14:16:20
I need to loop through all rows/columns in a sheet and remove rows contain certain words. Ideally, I would search through the sheet using a regular expression, but just finding a string would help get me moving. I'm seeing a lot of posts on Stack Overflow about finding and deleting empty rows, but can't find anything about searching an entire sheet and deleting a row if found. This is what I have so far: /* Delete rows */ function deleteRows() { var sheet = SpreadsheetApp.getActiveSpreadsheet(); var rows = sheet.getDataRange(); var numRows = rows.getNumRows(); var values = rows.getValues();

SpreadsheetAddRows failing on moderate size query

自作多情 提交于 2019-12-01 12:59:13
Edit: i changed the name as there is a similar SO question How do I fix SpreadSheetAddRows function crashing when adding a large query? out there that describes my issue so i pharased more succinctly...the issue is spreadsheetAddrows for my query result bombs the entire server at what i consider a moderate size (1600 rows, 27 columns) but that sounds considerably less than his 18,000 rows I am using an oracle stored procedure accessed via coldfusion 9.0.1 cfstoredproc that on completion creates a spreadsheet for the user to download The issue is that result sets greater than say 1200 rows are

Convert spreadsheet column index into character sequence

断了今生、忘了曾经 提交于 2019-12-01 12:56:35
问题 How can I the get character sequence, for example "AA" from column index 26 ? 回答1: Here's a recursive hash that will handle indexing for you: index_hash = Hash.new {|hash,key| hash[key] = hash[key - 1].next }.merge({0 => "A"}) index_hash[26] #=> "AA" The key here is the .next method, which when sent to a string, will return the alphabetically following string, e.g. "CD".next #=> "CE" . Could you clarify your first question? 回答2: class Numeric Alph = ("A".."Z").to_a def alph s, q = "", self (q