How to copy/write in excel sheet using rubyXL gem. Please advice - rubyxl

I am using the below option 'add'
worksheet1.add(2, 6, "A1")
I need to copy the text A1 in (2,6).
Error message is get is "undefined method `add' for # (NoMethodError)"

Adding Cells
worksheet.add_cell(0, 0, 'A1') # Sets cell A1 to string "A1"
worksheet.add_cell(0, 1, '', 'A1') # Sets formula in the cell B1 to '=A1'
https://github.com/weshatheleopard/rubyXL

Related

How to update a row using the Gspread python module

Hello basicaly i have this data, compose of name, project, reason and timestamps here's below is the structure
['John Doe', 'Hollywood', 'Good-time', '2022-05-17 15:25:45']
and on the documentation, it only shows how to update an individual cell, but i wanted to update entire row. Thanks in advance
You have 2 ways to update the content of you spreadsheet using gspread.
Using update method
It will update the specified range with values you provide.
Example: updating cells A2 to B2
worksheet.update("A2:B2", [[42], [43]])
Using update_cells
You create a list of Cell object with each value for each cell then update the cells
Examples: updating cells A2 to B2
C1 = Cell(2, 1, 42)
C2 = Cell(2, 2, 43)
worksheet.update_cells([C1, C2])

Three Dimension Vlookup

I have a master table with the following structure in excel :
How can I convert it as shown in the second picture by using the vlookup function? (function in yellow cells).
Three keys involved now: Daytime, User and Data Type (ADP_ERQ, ADP_SO)
Note: Column headers (Daytime, User, ADP_ERQ, ADP_SO) in the second picture are fixed.
Try this in C17 then fill right and down.
=INDEX($A$3:$Z$12, MATCH($A17, $A$3:$A$12, 0), AGGREGATE(15, 7, (COLUMN(1:1)+MATCH($B17, $1:$1, 0)-2)/($2:$2=C$16), 1))
For cell C17: IF(B17="USER_A",VLookup(A17,A3:C12,2,0),VLookup(A17,A3:E12,4,0))
For cell D17: IF(B17="USER_A",VLookup(A17,A3:C12,3,0),VLookup(A17,A3:E12,5,0))
In this formula replace A3:C12 and A3:E12 with your appropriate table range, then drag these down.

excel copying string found from cell one to a new cell

I have a formulas that is currently only returning true/false, I wanted to improvise it instead of returning true/false, can I get the string that is found and copy it to another cell?
here is the formula that I use :
=NOT(NOT(SUM(--NOT(ISERR(SEARCH($D$2:$D$21;$B2))))))
thank you
Try,
=INDEX(D:D, AGGREGATE(15, 6, ROW(D2:D21)/SIGN(SEARCH(D2:D21, B2)), 1))

EXCEL VLOOKUP to other workbook

i keep trying and trying but nothing always N/A
photo added.
i tried to put e:\onedrive\ubuy
but still didn't work.
i need that the left workbook in cell C2 will be vlookup of cell A2 in the right workbook from D2 cell
enter image description herel 2 to AA cell 400.
and will show me in C2 the value at AA.
Ty :[
command that i did
=VLOOKUP(A2,'[מחירון פריטים - עסקית.xlsx]xl_PriceList'!$D$2:$AA$375,23,FALSE)
Without changing your data, you can edit your formula to this:
=VLOOKUP(TEXT(A2, "#"),'[מחירון פריטים - עסקית.xlsx]xl_PriceList'!$D$2:$AA$375,23,FALSE)
The text(A2, "#") converts your lookup value to text format (same as the data you're searching) on the fly, so you don't need to edit your data.

Dynamically changing dropdown in excel

The scenario is as follows,
I have a list of options to be filled in one cell, say A1. The options can be filled using Data Validation-List which causes a dropdown to appear in A1. Now I want B1 to contain a dropdown, the entries in which change on the basis of the data in A1.
As a contrieved example, suppose A1 offers the choices Mammals, reptiles and amphibians. If I select mammal, I should get man, cat, dog as an option in B1. If I select Reptiles, snake and lizard appear as an option in B1. If I select amphibians, I should get Frogs and toads.
I would like to avoid using VBA for this.
Use the INDIRECT formula in the validation list as is clearly explained here:
www.contextures.com/xlDataval02.html
Here you go, a solution completely without VBA. It's using actual combo box controls from the "Forms" toolbar:
Add three extra worksheets to your workbook. I called them "domain", "data" and "animal"
on sheet "domain", I did:
enter (from cell A1 downwards) "mammals", "reptiles", "amphibians"
defined a name for range "domain!$A:$A": "Domain"
defined a name for range "domain!$B:$1": "DomainChoice"
on sheet "data", I did:
enter (from cell A1 downwards) "man", "cat", "dog"
enter (from cell B1 downwards) "snake", "lizard"
enter (from cell C1 downwards) "frog", "toad"
on sheet "animal", I did:
in A1, entered the following formula
=T(INDIRECT("data!R" & ROW() & "C" & DomainChoice; FALSE))
filled this formula down to, say, row 50.
defined a name for range "animal!$A:$A": "Animal"
defined a name for range "animal!$B:$1": "AnimalChoice"
on the main worksheet, I created two combobox controls:
in box 1, I defined the properties ("Format Control...") as follows:
"Input range:" - "Domain"
"Cell link": - "DomainChoice"
in box 2, I defined the properties as follows:
"Input range:" - "Animal"
"Cell link": - "AnimalChoice"
Now should "mammals", "reptiles", "amphibians" appear in box 1, and the contents of box 2 should change based on the selection.
Look at the various sheets to see what happens behind the scenes. The only requirements are that the order of the values in the "domain" sheet corresponds to the columns on the "data" sheet, and that can only be as many animals as there are rows filled with the formula on the "animal" sheet.
You can hide the three helper worksheets, if you want.
The formula, explained:
T( // returns an empty string unless the argument is a text value
INDIRECT( // returns the value at the given reference string
"data!R" // build a dynamic reference string to "data!R1C1"
&
ROW() // the current row, changes as you fill down the formula
&
"C"
&
DomainChoice // defined name of "domain!$B:$1", contains box 1 choice
;
FALSE // flag to indicate that the formula is in "R1C1" format
)
)

Resources