Merge cell and copy equation in google scripts in google sheets - scripting

I am looking to make a script that will merge cells to like the blue ones are based on the ones in the green when the only constant is the cell that says credits. I am hoping for an option that make it variable but I can live with it doing the the same amount of cells each time just as long as it happens only when the associates cells.
enter image description here
I am also looking to have a script fill the column that the green options are with copies of that equation keeping the relatively of the equation and places them in when the column that the blue cell is in has the cell filled
enter image description here

Related

Conditional formatting 1 cell based on cell input on another sheet, apply to entire row

For work I need to create a resource management excel file. My goal is to create an overview as is seen here:
If John would have taken a few hours off, or if he has a fey hours of sick leave, I would like to turn this cell only to change colour so I know that John will be absent for whatever reason on this day.
However, since I'm creating this for an entire row (for a whole year), I do not want to create conditional formatting per cell because that would be plain madness.
Here is an example per employee (in this example John):
enter image description here
So what I need is a formula to check if a cell in a row (for example sick leave) on the employee worksheet is grater than 0 and then change the colour of only the corresponding cell on the recourse planning worksheet, not the entire row.
Does any of you guys know if this is possible in excel 2016? Preferably without VBA scripting since I have to transfer this excel file to a co-worker who is not into VBA programming.
Thank in advance.
Nuntius transmittendus!
This is definitely possible without any code. Use CountIf() as tinus087 commented. The tricky part is how to create the address range used by the CountIf() so that you can put one conditional format on all the cells. On the the one hand you need the column of the cells being checked to match the column of your total cell. On the other hand the worksheet tab name needs to change depending on which row you are on. So use INDIRECT() to point to the correct worksheet and OFFSET() to look at the correct cells.
So, for cell C4, the formula you want to use as the range in your CountIf() is OFFSET(INDIRECT($A4&"!A1"),3,COLUMN(C1)-1,4). When applied to cell C4 this creates address John!C4:C7. When used for cell D4, it results in John!D4:D7.
You'll probably want some error checking to deal with the #REF! error happens when the formula is applied to a row without a first name or where the name listed doesn't match any worksheet tabs.
Something else to think about, if you haven't already, what happens if there are two John's? Is the 2nd John going to be named John2?

Use conditional statements to add data to scatterplot

I am new to VBA and have not had experience with creating many charts.The chart has to be created by hand because the data has to be visually inspected to see if it meets certain criteria, and not every cell in a column needs to be added to the chart. The chart is to show information for each asset. Not every asset will have information that can be entered on the graph. Is there a way to use VBA to conditionally add data points to a graph?
For example if an asset sees values between 0-30 plot a dot (green) 30-50 (red) etc.
Such a scenario can be achieved with data layout and formulas. No need for VBA, which would need to be re-run, where as formulas will update automatically.
Consider the following screenshot:
The formula in cell C3 is =IF($B3<30,$B3,NA()) and in D3 =IF($B3>=30,$B3,NA()) copied down.

Advanced substitute in excel with range

I'm trying to replace 1400 cells with text into cells with ids, I've attached a picture so you can understand it easier. I'm trying to do this only by using cells because I have 1400 cells I need to replace.
I've trying using substitute using a range but I can't seem to make it work.
=SUBSTITUTE(H2;K2:K999;J2:J999)
It sounds like you don't want to use a VBA solution?
If you don't mind moving some stuff around, try this.
Damn, that image isn't big enough, is it? You can see the layout though. "Original Text" is in C1, and the word ID is in A5, and I've numbered D1:I1 1-6. Now paste this formula into D2: =SUBSTITUTE(C2,OFFSET($B$6,D$1-1,0),OFFSET($A$6,D$1-1,0))
And drag it right and drag all the columns down. Your desired output should be in column I. It's not the most computationally efficient, but it's super easy to implement and works with any size lookup table (just drag out more columns and number them) and any number of items in the text fields.

Where is this EXCEL Sheet's data stored?

I am stuck at this problem which involves extracting data from a excel spreadsheet. And the values are "hidden" behind a "interface". I was given a excel file with the coordinate system and for the specified coordinates, when you click on them, a value is displayed to you on the small window above the spreadsheet.
I need all these values and I am sure that I could extract them all at once, not one by one.
So I need to gather all the values that are assigned to the specific coordinates and implement it in my program. Also there is this red-green interface which points out if the value is above a specified number.
But how do I get to the values?
Excel Spreadsheet Link.
They are stored in that row by column. The reason that you cannot see them when you open it is that the size of the column have been reduced. To see the actual number in the row by column, just expand that column by dragging it to the right. For example, in spreadsheet EEM_80_Eini+Ausi, if you look at cell B3 and expand the row and column, you will see the number .2450610558 inside that cell.

How to duplicate cell data in excel between rows if the cells are empty when another cell matches

I know the title is really long winded, I will try to explain
I am trying to get Magento products into Zen Cart (background only - shouldn't be relevant).
I have an excel 2010 xls spreadsheet and in it I have a load of product data: skus, prices, categories, etc... you get the idea. I have each of the products along with their data listed once, each with a unique SKU field.
But... Some of these products are in more than one category and the way I am importing, each product needs to be listed multiple times, once for each category.
So, I have done an sql dump which contains two columns; sku and category. I have pasted these values into excel as new rows, so now I have a situation like this (with a lot more entries):
As you can see for each sku (left highlight) there is one entry containing all the data apart from the category (right highlight) and then there is an additional entry for each category it belongs to which contains only the category and sku but none of the other data.
So, what I need to do is some how copy all the data (apart from the categories column) across all cells with the same sku. Does anyone have any idea how I can achieve this without hitting Ctrl+V several hundred times. I realise VBA can probably handle this pretty easily, but I dont have a clue on that front.
Any help greatly appreciated
I hope you’re willing to use a second sheet, and to reference the data rather than actually copying.
On Sheet2, set A1 to =IF(Sheet1!A1="", "", Sheet1!A1).  Drag (extend/fill) this down to A500 (as much data as you have on Sheet1, or further, to allow for growth).  Also drag A1 over to AA1 and then drag that down to AA500.
Then set B2 to =IF($AA2="", Sheet1!B2, B1), drag it to Z2, and drag B2:Z2 down to B500:Z500.
P.S. If any of your data (columns) are dates, you will probably need to explicitly format them as dates on Sheet2.  Ditto for any other values that are formatted any non-default way (e.g., Currency or Percentage).  It may be necessary to do this only to cells that have values in them (and not blank cells).
You don't need VBA, unless you need to do this many times.
Assuming the sheet with your data is called Source and the sheet with the result is called Dest, you can get what you want following these steps on the sheet Dest:
On A1 type =Source!A1
On A2 type =IF(ISBLANK(Source!A2),A1,Source!A2)
Select the range A1:XX1 (where XX is the last column of the sheet Source)
Press Ctrl+R (to copy the first cell to the right)
Select the range A2:XX## (where ## is the last row of the sheet Source)
Press Ctrl+R and Ctrl+D (to copy to the right and down)
Here is an explanation of what's going on:
The first row is copied from the Source as it is.
Each cell of the second row is copied from Source only if that cell is empty, otherwise the cell above is copied.
Here's the quick and dirty solution:
Select the columns you need to be filled
Press Goto Ctrl-G
Special `Alt-S'
Blanks (Alt-K, Enter)
This should select all blank cells. Now type =B2 (assuming you're in B3, i.e. use the cell above the active cell) Important: Press Ctrl-Enter instead of Enter to enter the formula.
Done!
On a new Worksheet get the numbers 1-26 running across the top in Row1 by typing 1 in cell A1, 2 in cell A2, and then selecting those two cells and filling through Z.
Now in A2 type the following formula =VLOOKUP(Sheet1!$A1,Sheet1!$A:$AA,VALUE(A$1),FALSE)
Fill this formula in the Range A2:Z## (where ## represents your last row of data).
Then copy Row1 from Sheet1 to Row1 on Sheet2.
This formula will copy the rows of data straight down into the empty rows below them (assuming the sku only changes where there is a row of new information.
This will then all be active formulas, so I would recommend selecting all on Sheet2 and right-clicking in cell A1, and paste special by value.