How to delete blank cells of the column in Google Sheets? - google-sheets

I am trying to get rid of the blank cells of the column in my sheet. I get some data from my colleagues via Google Form, and I have made some subcategory questions for them. So they get to select one of the five given choices. When I export the data to the sheet, it appears somewhat like below (linked):
https://docs.google.com/spreadsheets/d/1DBrFFNst0nhZAtxHejsrbNGkMxvcbOuie47era0Hl8c/edit?usp=sharing
Because the users can select one choice, out of five given choices four other cells must be left empty. Here's where I'm struggling with:
I have used filter function to get rid of the blank cells, but then it is restricted to only set the range either single row or column. So I end up with what you would see in my sample worksheet.
I've tried arrayformula and query as well, but I couldn't figure out a way out of this.
Any help would be appreciated.

=ARRAYFORMULA({B1:G7, {"subcategory"; TRIM(TRANSPOSE(QUERY(TRANSPOSE(H2:L7),,999^99)))}})

Related

How to get sum/difference From a different sheet using dates as reference?

Collections Sheet
Expenses Sheet
Hi, I would like to get the daily sum/difference of the expenses from the expenses sheet then output to collections sheet using dates as reference/identifier.
I tried this code =MINUS(C8,INDEX(Expenses!20:31,12,2)) but I want it to auto compute when I drag the box. sorry for bad english. thank you
Desired output:
Desired Output
Output at (Net) Cash On Hand Row / Reference Date Column, the output should be August 1 Collection - August 1 Expenses.
The main issue is with the structure of your expense sheet, since you need to use only every second column. For this you can use various methods, something like
=split(substitute(join(";",Expenses!A2:DJ2),"Total:;",""),";")
The join function takes the whole row and joins it into one string, the substitute function removes the Total: from it, along with the trailing ; and the split function separates it again to separate values. This will be an array, automatically spread out to 31(-ish) columns width if entered into a cell like C10 on your Collections sheet.
Then you have two options, simply do =C8-C10 in C9, which you can drag with no problem. You can also hide the row 10 by making the text color white, or even integrate it in that sheet.
My recommendation however is not to do any of that, instead enter the formula
=arrayformula(C8:AG8 - split(substitute(join(";",Expenses!A2:DJ2),"Total:;",""),";")
into C9 on the Collections sheet and it's taken care of, without the need to drag it out. You might need to tweak it, not sure if the AG8 and DJ2 are the correct columns to end them on (should be the last column if every column or every 2 columns is a day). The arrayformula makes sure that the subtractions are done automatically for each pair of values, and expanded automatically into the row. Make sure that there are no values or formulas in D9:AG9, so it can fill up the values automatically and you don't get a #REF error.

Google Sheets Double Lookup

I'm trying to figure out a way to lookup specific information from different tables. I have one table with teams and the points they have scored depending on the Week.
A second table with the Schedule and Matchups
I'm trying to cross reference the two tables so I can enter information in a third table.
I first was trying double VLOOKUP, but I'm not sure if that is possible as I wasn't having any success. I'm able to get an Array that is close to the information I need so I can perform the VLOOKUP, but I'm unable to perform the second VLOOKUP to get the score of TEAM B.
I was able to solve this issue with a helper column to combine the information, but I'm trying to avoid that.
Demo Sheet: https://docs.google.com/spreadsheets/d/18LKD_IwfulaSSAdHJ6qtISCF5kY4IgD32lJzZqKfqfY/edit?usp=sharing
This formula will work in just the top left corner of your "opposing" results table as demonstrated in the new tab called MK.Help.
=ARRAYFORMULA(HLOOKUP(VLOOKUP(B18:B19&C17:F17,{B11:B14&D11:D14,E11:E14;B11:B14&E11:E14,D11:D14},2,0),C3:F5,SEQUENCE(ROWS(B18:B19),1,2),0))
You could try to put this formula on cell C18 and drag to down and right:
=ArrayFormula(VLOOKUP($B18,$B$4:$F$5,MATCH(INDIRECT(ADDRESS(MAX(IF($B18=$B$11:$B$14,(C$17=$D$11:$E$14)*ROW($D$11:$D$14),"")),IF(MAX(IF($B18=$B$11:$B$14,(C$17=$D$11:$E$14)*COLUMN($D$10:$E$10),""))=4,5,4))),$C$3:$F$3,0)+1,0))
I have already put the answer on your sample sheet.

Get row index of all non-empty cells in a column in Google Sheet

I want to create a function that gives me a list of all the nonempty row indices in the example shown below (i.e., 3,4,6,7,8,9,12,15).
After that, I want to select, for example, the third number in this list (i.e., 6).
I can't figure out how to make it happen (I am still fairly new to Google Sheet formulas), so very thankful for your help!
Sheet example:
It is not quite clear to me what you need.
I think you are asking for the # of the 1st row below 3rd empty row
=SMALL(ArrayFormula(IF(B1:B="",,ROW(B1:B))),3)
You can also find the # of empty rows using:
=ArrayFormula(IF(B1:B<>"",,ROW(B1:B)))
Change it to the following to get a list of non-empty rows
=ArrayFormula(IF(B1:B="",,ROW(B1:B)))
In any case, I have also included a couple more useful formulas
the # of the 3rd empty row
=SMALL(ArrayFormula(IF(B1:B<>"",,ROW(B1:B))),3)
and finally, the row content of the above formula
=INDEX(B1:B,SMALL(ArrayFormula(IF(B1:B="",,ROW(B1:B))),3),1)
(if still facing issues, do let us know)

Count specific words in table for each row that begins with a cell of a certain value (Google Sheets)

That's about as clear as I make what I'm trying to do in Google Sheets.
Here's a sample table with two tabs.
Tab 1
Basically, I've got a table fed from a form. One column has names of say 50 various people. The names repeat randomly.
Other columns contain comments that each person made.
Tab 2
Here is essentially a heat map of keywords used by the different people. Column A are the keywords, while row 1 contains the keywords I'm interested in.
Each cell in this grid should (1) search tab 1 for all instances of each name, then (2) count the number of times the keyword appears in all of that person's comments.
Countifs doesn't work because the array arguments are different sizes.
I can't figure out how to phrase a filter embedded in a countif.
And using QUERY seems like it will cause trouble because my actual spreadsheet is something like 100 names and 40 keywords.
I'm open to suggestions and grateful for your help!
ken.
In B2 try
=sum(ArrayFormula(--regexmatch(filter(Sheet1!$B$2:$F, Sheet1!$A$2:$A=B$1), "\b"&$A2&"\b")))
Then fill down to the right and down as far as needed.
To make the match case-insensitive, change "\b"&$A2&"\b" to
"\b(?i)"&$A2&"\b"
See if that works?

Google Spreadsheet & ArrayFormula - auto-adding formulas

I'm having problems with something that is likey very simple to correct. I have a form that submits data to a Google Spreadsheet, simply a date, name and score. On a separate sheet I am going to have a leaderboard which shows all submissions ranked by highest score (for simplicity in the example in the link below, I just have the leaderboard showing up on the right of the same sheet). I have it sorting the data fine, but I'm struggling with getting the 'rank' value to display. As shown for the first 3 rows (G2, G3, G4) I know what the formula is to display the 'rank' value...but what I'm struggling with is how to get that value to show without having to have that formula in each cell. Since the data will be coming from a form, there will obviously be new rows added regularly which means the leaderboard will automatically get adjusted and I want all of the rows to display the rank #. From what I have read, ArrayFormula should allow this to work, but even with looking at examples I can't figure out how to get it to work with my formula.
I know I could just highlight the entire 'G' column and paste in the formula, and hope it adds it to enough rows...but then it displays 'N/A' for all of the rows which don't currenlty have any data.
Hoping its just a simple solution that I'm being dumb and missing...any help would be greatly appreciated. The link to an example is below. To summarize, for all rows that have content in column H and I, the G cell for that row should show the rank value automatically.
https://docs.google.com/spreadsheets/d/1pCIJQi5g2scOtB6o2PgVVb-0azzhupEOPjiL0RMM57A/edit?usp=sharing
Thank you!
=ARRAYFORMULA(RANK(INDIRECT("I2:I"&COUNTA(H:H)),$I$2:I,0))
This will automatically rank and sort, for all values, including additional ones that are added. You only need to enter it into G2, and it will dynamically fill in the rest for you.
You can use
IFERROR(RANK(...),"")
and drag it to all rows - this will leave blank cells instead of #N/As. I'm sure there are other ways but that seems like the easiest one to me.

Resources