In one of our project website, we are about to use Google spread sheet for our clients to enter some information and do some spread sheet work. So using Google APIs We can create spread sheet on our website and allow users to enter details in it. But my question is that is it possible to lock rows and columns so users can only enter data in the field they are allowed to modify?
For example,
--------------------------
| Car Rent | |
| Total Gas | |
| Insurance | |
| Commission | 1% |
--------------------------
Lets say this is our basic template for spread sheet for all of our users. The can enter Car rent, total gas and insurance value but they are not allowed to modify anything else, including row headers or any other empty cell outside this box. So is there anyway to lock it for users in spread sheet? Can anyone point me to guide or api details?
Thanks
Related
I have some data that was set up poorly coming from Firebase Realtime Database. I will be updating the way the data is stored to make it easier to work with in the future, but for the data that exists I'd like to find a way to make it readable for a report. The data is coming in from the Realtime Database API into Google sheets, and it looks like this right now:
10/01/2020 abc123 Email | 10/01/2020 abc123 Status | 10/01/2020 abc123 Time | 10/01/2020 def456 Email | 10/01/2020 def456 Status | 10/01/2020 def456 Time
fake#email.com Clocking In 12:10:50 fake#email.com --------Clocking Out -----------15:16:53 GMT-0400 (EDT)
I did my best to get format that like a table, hopefully it gets the point across (the hyphens were necessary to keep formatting).
Anyway, the object with headers like "Date random letters and numbers for id Field". Is there any way to group it more so it's like:
ID | Email | Status | Time
Date abc123 | fake#email.com | Clocking In | 12:10:50
Date def456 | fake#email.com | Clocking Out | 15:16:53
I've got hundreds of these, so I'm hoping to find a way to automate it and make this data readable for other people
On a new tab called MK.Help in the sample sheet you provided, This formula will grab ONLY every 3rd column and transposes it to show the email addresses.
=TRANSPOSE(FILTER(Sheet1!2:2,MOD(COLUMN(Sheet1!2:2),3)=1))
Similarly, this one will grab every third, but a starting in a different place to grab the In/Out.
=TRANSPOSE(FILTER(Sheet1!2:2,MOD(COLUMN(Sheet1!2:2),3)=2))
This one will do the same for the Times, but it first Adds the date to it so that you can get a full timestamp. It uses some text manipulation functions, specifically LEFT() to only grab the data from each row necessary to construct a proper timestamp
=TRANSPOSE(FILTER(IFERROR(1/(1/(LEFT(Sheet1!1:1,16)&LEFT(Sheet1!2:2,8)))),MOD(COLUMN(Sheet1!2:2),3)=0))
Not sure if this is the best place to ask about spreadsheets, but here goes:
I'm trying to help someone modify information on one spreadsheet document when information on a separate spreadsheet document is modified (without coding a solution from scratch using the sheetsAPI).
For example, my client has a product database stored in a spreadsheet document, products, when a customer places an order on the clients website, a separate spreadsheet document, openOrders, is updated using the sheetsAPI and some server code. When this document is updated, I'd like to subtract the quantity of items being ordered, from the quantity of the item (or items) available being listed in products. I'm wondering if letting these spreadsheet documents "speak" to each other is possible without coding a solution server-side using the API.
products looks kind of like this:
Product Name | Units | Unit Price
---------------------------------
Product 1 | 6 | 1600
Product 2 | 3 | 1200
Product 3 | 17 | 400
Product 4 | 2 | 600
openOrders looks kind of like this:
Product Ordered | Units | Unit Price | Total
--------------------------------------------
Product 3 | 1 | 400 | 400
Product 2 | 2 | 1200 | 2400
Product 3 | 5 | 400 | 2000
Product 1 | 1 | 1600 | 1600
When the openOrders sheet is updated with a new order, I'd like to subtract the number of Units ordered, from the number of Units available in products. Keep in mind these are two separate spreadsheet documents. I am new to spreadsheets so this is all very foreign to me, it could be possible that I'm using the spreadsheets in a fundamentally incorrect way, and I'm open to that possibility.
you can do:
=ARRAYFORMULA(QUERY({A2:A, B2:B*-1;
IMPORTRANGE("ID_of_spreadsheet", "Sheet1!A2:B")},
"select sum(Col2) where Col1 <> '' group by Col1 label sum(Col2)''", 0)*-1)
I am trying to track my expenses manually. I looked for already built options and I did not find anyone I knew how to use or that it covered what I want to do.
What I am doing is basically manually write down what appears in my bank, with the intention of categorizing the expenses myself, since as I said, I did not find a better way to do it.
So it looks like this:
Cinema | 11.95
Going out (restaurant1) | 26.55
Netflix | 13.95
Weekly purchases | 72.66
Going out | 9
Bill (type) | 29.16
Rent month | 650
Going out | 26.55
Bill (type2) | 66.45
Compra semanal | 81.09
Bill (type3) | 21.1
( "|" is used as if it were two different cells) And what I would like now is to take the generic name that I gave the cathegory (without the parenthesis, I am using those for myself, so I can track where was the money spent, more specifically), and how much was spent.
In programming I would do this with a regex for the left cell, and aggregating by name, and then plotting the data somehow. I am unsure if this is even possible, maybe I should use Excel but Drive has the cloud advantage so I would like some help as to where to start, I do not need anything too fancy, a new column with the category and the total spent would work wonders for me, but I have not found an easy way of doing it (and I doubt I am doing something so complex, so I assume I am thinking this the wrong way). Best case scenario, I manage to plot it all so it is more visual, or I can have several columns plotted against each other (I have different columns for shared expenses, personal expenses, and so on).
If you can put the category (e.g. Bill) in a separate column from your details (e.g. type 1) then the Pivot Table feature is exactly what you need.
Start with something like this (the heading on each column is important):
Category | Details | Amount
Cinema | | 11.95
Going out | restaurant 1 | 26.55
Netflix | | 13.95
Weekly purchases | | 72.66
Going out | | 9
Bill | type | 29.16
Rent month | | 650
Going out | | 26.55
Bill | type2 | 66.45
Compra semanal | | 81.09
Bill | type3 | 21.1
Then click Data, Pivot Table. Under Rows, click Add and choose Category. Under Values, click Add and choose Amount. You should see a table like this:
Category | SUM of Amount
Bill| 116.71
Cinema | 11.95
Compra semanal | 81.09
Going out | 62.1
Netflix | 13.95
Rent month | 650
Weekly purchases | 72.66
Grand Total | 1008.46
Any unique value in the Category column creates a new row in the pivot table.
Further Details: https://support.google.com/docs/answer/1272900
=ARRAYFORMULA(QUERY({REGEXREPLACE(TRIM(A:A)," \(.*\)",),B:B},"Select Col1,sum(Col2) where Col1 is not null group by Col1"))
I have a spreadsheet from a Google Consumer Survey. The survey captured demographics as well as the responses to a question. Acceptable responses could have chosen zero or more 'answers'. The response for each answer is in a unique column. For example,
user id | gender | age | income | answer 1 | answer 2 | answer 3 |
0001 | Female | 20-30 | 50-75 | [empty] | Right | Never |
0002 | Male | 20-30 | 30-50 | Up | Left | [empty] |
I would like to know how to correlate a column of demographic info with each of the possible answers. For example, I want to be able to answer questions like, Were males more likely than females to choose X for answer 1? and Which age group was more likely to choose Y for answer 2?
I prefer an answer using Google Sheets functions, but I am open to learning other ways to understand the data. Thank you for any help!
Good way is to use query function. Let's first assume, your data is stored in range A:G:
A | B | C | D | E | F | G |
user id | gender | age | income | answer 1 | answer 2 | answer 3 |
0001 | Female |20-30| 50-75 | [empty] | Right | Never |
0002 | Male |20-30| 30-50 | Up | Left | [empty] |
you may write simple query functions.
For example, to count all answer 1, group them by gender and age, pivot by answer 1:
=query(A:G,"select B, C, count(D) where not A is null group by B, C pivot E")
where not A is null -- prevents empty data to be used in query
count(D) -- can count any column, that wasn't already used by query
group by B, C -- must contain all selected items, except aggregates (count, sum, ets.)
pivot E -- will make all answers to show in separate columns.
The result will look like this:
Left Never Right Up
Female 20-30 1 1 1
Female 30-40 1
Male 20-30 1 1 1
Male 30-40 1
Please, look at complete Query Language Reference to learn more.
Have you tried using the Pivot Table function of Google Sheets?
Download the data in excel format after the survey is complete and open with Google Sheets
Select the tab with the resulting data from the Google Consumer Survey after it is run.
From the menu, select Data -> Pivot Table. This opens a new tab in your spreadsheet.
For the Values area of the pivot table, select User ID and from the "Summerize by" dropdown, select COUNTUNIQUE
For the columns and rows, select whichever dimensions you are interested in. For instance, in your example, you would pick
"Gender" and "Answer 1" as a row and column.
"Age" and "Answer 2" as a row and column.
This should answer these kinds of questions easily.
Hope this helps!
What I think I needed was the COUNTIFS function (in Google Sheets). Notice the plural use, which is different than countif (singular).
COUNTIFS allowed me to specify multiple criteria to make a score for each demographic segment. For example, I could count all the Males that responded Up in the answer 1 column.
I'm trying to link three spreadsheets in Google Sheets by using the pivot tables functionality.
The problem that i have now is that i don't find a way to pull the data for more than one sheet. I can only operate the Pivot table with the information coming from only one.
I have researched quite a lot, but my impression so far is that the documentation available for Google Docs is not so extensive at some point.
Basically what i need to do is the following:
Table 1(main):
Car Name | ModelId | ColorID
ford | 1 | 1
fiat | 2 | 2
Table 2:
ModelID | Name
1 | mustang
2 | bravo
Table 3:
ColorID | Name
1 | Red
2 | Blue
Resulting pivot table:
Car Name | Model| Color
ford | mustang | Red
fiat | bravo | Blue
In SQL statements i'm basically trying to simulate a JOIN.
I also could write a javascript script but i would like to know if there is a simple way to achieve this without coding.
Thanks!
This formula reproduces your example output and will update if more records are added to the 3 tables:
={"CarName","Model","Color";
Table1!A2:A,
ARRAYFORMULA(IFERROR(VLOOKUP(Table1!B2:B,Table2!A:B,2,0))),
ARRAYFORMULA(IFERROR(VLOOKUP(Table1!C2:C,Table3!A:B,2,0)))}
This example sheet shows the formula working.