Make Sheets Enter Row Number into a Designated Cell - google-sheets

In Google Sheets, if I write "Jeff" in a cell on Row "X", how do I get "X" (row number where I wrote "Jeff") to be entered into a cell on row "Jeff" on another sheet.
Sorry if this is a weird request, I have some experience with Excel Macros but I can't figure this out
The Sheet with the yellow highlight is what I want to manually enter, the Sheet with the blue highlight is what I want the code to make for me
Input:
Result:

this is how you get a list of names with rows:
=ARRAYFORMULA(QUERY(TO_TEXT(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
"♠"&B1:E&"♦"&ROW(A1:A)),,999^99)),,999^99), "♠")), "♦")),
"where Col2 is not null", 0))

Related

Google sheets splitting text to rows

I am trying to create an inventory system where I input the items of a drawer as a list separated by commas along with the drawer number and google sheets returns that list as separate cells, but with the same drawer number.
This is what I have
This is what I have
and this is what I want it to return, ideally on a separate sheet. I split the text into the rows using =transpose(SPLIT(Sheet1!C3, ",")), but what I'm stuck on is filling the column to the left (the drawer number A1, A2,...) I did it manually but it would be a pain to do so for all of the drawers. Is there any way to do this using a formula?
There won't be the same number of items in each drawer.
Here's my workbook if that's helpful. https://docs.google.com/spreadsheets/d/1ayXmwtJ1V4LB2ANgIYXscP-_KcuTWUTzMOHOYwPM_z0/edit?usp=sharing
use:
=ARRAYFORMULA(TRIM(QUERY(SPLIT(FLATTEN(
IF(Sheet1!C2:C="",,Sheet1!B2:B&"×"&SPLIT(Sheet1!C2:C, ","))), "×"),
"where Col2 is not null")))

Apply VlLOOKUP till last non-empty row in google sheets

I have an automatically expanding google in which I am applying a Vlookup formula to extract values from another sheet matching the values from the main sheet.
This is the Vlookup formula-
=VLOOKUP(A2, IMPORTRANGE("1MNRMKGkC-c0COugUWpXOe5OxJXfmdXGboxAPhf5SaLA", "Sheet1!B3:E420"),4,0)
I want the formula to be auto applied to the new entries which get auto added in the main sheet. I used this formula I found on a website to apply this formula to the whole column also taking care of any empty cells in between.
=ArrayFormula(IF(ISBLANK(A2:A), "", VLOOKUP(A2:A, IMPORTRANGE("1MNRMKGkC-c0COugUWpXOe5OxJXfmdXGboxAPhf5SaLA", "Sheet1!B3:E420"),4,0)))
My problem is that after using this formula when a new entry is auto added to column A in the sheet, it gets added to 1001th row instead of the next non-empty row, because this formula is being applied to whole column.
Is there some way to apply the Vlookup to just be applied till last non-empty row, so that my next automatic entry gets added in the next empty row? Or any other alternative solution?
Thanks for the help!
try:
=ARRAYFORMULA(QUERY(IF(ISBLANK(A2:A),,VLOOKUP(A2:A,
IMPORTRANGE("1MNRMKGkC-c0COugUWpXOe5OxJXfmdXGboxAPhf5SaLA", "Sheet1!B3:E420"), 4, 0)),
"where Col1 is not null", 0))
Since we don't have sheet for reference assuming new data is added to new column.
Try this fromula =ARRAYFORMULA(If(A2:A="","",VLOOKUP(A2:A, IMPORTRANGE("1MNRMKGkC-c0COugUWpXOe5OxJXfmdXGboxAPhf5SaLA", "Sheet1!B3:E420"),4,0)))
This will do vlookup once there is new data in Column 'A'

how to reshape input dataset with formula

I want to work the following. I am using this formula
=ARRAYFORMULA(Split(Transpose(Split(Query(Transpose(query(transpose(if(Input!B2:I<>"", ";"&Input!A2:A&"\"&Input!B2:I, )) ,,999^99)),,999^99), ";")), "\"))
but it does not give the desired results. Here is the desired output 'Automatically restructure all data from input tab as "Example Output" tab illustrates
No rows for "blank" cells in the input tab
Use formula(s) only in the first row - i.e. no need to drag cells down the entire sheet, and this tab auto-updates when new entry made in Input tab"
get the sheets on this link
and give ideas on how to improve the formula or insights into how you can do it differently
=QUERY({Input!A2:C;
Input!A2:A, Input!D2:E;
Input!A2:A, Input!F2:G;
Input!A2:A, Input!H2:I;
Input!A2:A, Input!J2:K}, "where Col3 is not null", 0)
=ARRAYFORMULA(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(
QUERY(TRANSPOSE(IF(LEN(Input!A2:A),
"♦"&Input!A2:A&"♥"&Input!B2:B&"♥"&Input!C2:C&
"♦"&Input!A2:A&"♥"&Input!D2:D&"♥"&Input!E2:E&
"♦"&Input!A2:A&"♥"&Input!F2:F&"♥"&Input!G2:G&
"♦"&Input!A2:A&"♥"&Input!H2:H&"♥"&Input!I2:I&
"♦"&Input!A2:A&"♥"&Input!J2:J&"♥"&Input!K2:K, ))
,,999^99)),,999^99), "♦")), "♥"), "where Col3 is not null", 0))

Three Google Sheets' data graphs (pie charts) in one graph

I have three google sheets of data in one spreadsheet. these sheets containing the data of ABC Town students. ABC Town has 3 Streets called Street 1, Street 2 and Street 3.
Street 1 has 10 Students in different grades.
Street 2 has 6 Students in different grades.
Street 3 has 2 Students in different grades.
Every sheet has Students Grade summary Pie Graph. Now What I need is,
I have to combine these three pie charts into one chart to get a final summary of three sheets. how can I do this? Please.
This is my spreadsheet: https://docs.google.com/spreadsheets/d/1NmCSRPaoGCpuyfxv24z2-M8TNktBjHNt7BoaMF6LCJY/edit?usp=sharing
explained in image:
or maybe you just want to combine all 3 charts (?) like:
demo spreadsheet
if you map out your data the right way you can create pie chart with sub-slices for each of your three pie charts and then you will just layer them. here is an example:
your dataset of A1:C is not in "good" shape for creating a chart, so first, you will need to re-shape it by adding few formulas in auxiliary columns which you can hide when done
in cell E1 paste this formula and create a base pie chart. this will create even ratio between Libaries. select primary color for each libary and maximze chart style
={"Libaries"\""; {TRANSPOSE(SPLIT(REPT(1&" ";
COUNTA(UNIQUE(FILTER(B2:B; B2:B<>""))));" "))\
UNIQUE(FILTER(B2:B; B2:B<>""))}}
if you got #ERROR! paste this into E1 cell:
={"Libaries",""; {TRANSPOSE(SPLIT(REPT(1&" ",
COUNTA(UNIQUE(FILTER(B2:B, B2:B<>""))))," ")),
UNIQUE(FILTER(B2:B, B2:B<>""))}}
paste this formula in G1 cell to create labels:
=ARRAYFORMULA(SPLIT(JOIN("×";
TRANSPOSE(REPT(UNIQUE(FILTER(B2:B&"×"; B2:B<>"")); 2))); "×"))
then paste this formula in G2 to create dataset for 2nd chart:
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0))
after this you will need correction formula which can correct position of the first set of pie slices. paste this in G6 cell and create 2nd pie chart from range G2:H. then play with colors and set color of the correction pie on None
=IF(SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3)
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0)))>3;
SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select Col3, count(Col3)
where Col1 is not null and Col2='"&G1&"'
group by Col3
label count(Col3)''"; 0)))*2; 6)
when done, overlay 1st chart with 2nd chart
then paste this formula in i4 cell (this will be dataset for 3rd chart)
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&I1&"'
group by Col3
label count(Col3)''"; 0))
next you need correction again. this time twice. paste this formula in i2 and i7
=SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C),
"select Col3, count(Col3)
where Col1 is not null and Col2='"&I1&"'
group by Col3
label count(Col3)''", 0)))
now you can construct 3rd pie chart from range i2:J. again play with colors and hide correction slices. when done overlay it on top of 1st and 2nd chart
when done paste this formula in K4 cell (this will be dataset for the 4th pie chart)
=ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3), Col3
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0))
and again you need to correct the position with this formula pasted in K2 cell
=IF(SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select count(Col3)
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0)))>3;
SUM(ARRAYFORMULA(QUERY(TO_TEXT($A$2:$C);
"select Col3, count(Col3)
where Col1 is not null and Col2='"&K1&"'
group by Col3
label count(Col3)''"; 0)))*2; 6)
create 4th pie chart from range K2:L, play with colors, hide correction slice, possition it on all previous charts
if you want to put up some labels then you can insert drawings and overlay it once again
demo spreadsheet

How do I reference one cell created in ARRAYFORMULA from another?

Let's say I'm using ARRAYFORMULA to generate values (whitespace is for readability):
=ARRAYFORMULA({
Sheet1!A1:C,
Sheet1!A1:A * Sheet1:B1:B,
Sheet1!A1:A * Sheet1:B1:B + Sheet1!C1:C
})
The first 3 cells are directly from Sheet1.
The 4th cell is a formula using the values from the first 2 cells.
The 5th cell is a formula using the value from that 4th cell, and then adding the 3rd cell.
Instead of needing to re-calculate the 4th cell in the 5th cell, is there a way to reference the result of the 4th cell in the 5th cell?
No, there is no way to reference a column of virtual array {} within the same array. Two workarounds are:
Create the column A*B+C using a second array formula, which references the output of the first
or,
Wrap the output of arrayformula in a query which can reference the columns as Col1, Col2, ...
Example:
=query(arrayformula({A1:C, A1:A*B1:B}), "select Col1, Col2, Col3, Col4, Col4+Col3 label Col4+Col3 ''", 0)

Resources