Google Sheets. Is it possible to give a word a value? - google-sheets

I want to give words number values.
Eg. Monthly =12, Quartly = 4
What are some ways I can do this?
Thanks.

you can use the Named Range feature to name a cell. They can be in another sheet even (not another document, another sheet in the same document)
Steps
In the menus Click Data and then Named ranges. A menu will open on the right.
In a cell type 12
Select the cell with 12 in it
Click "Add Range" on the right
Type Monthly for the name
Click Done
Repeat the steps 2 to 6 for Quarterly
Now in some other cell (even on another sheet in the same document) type =Monthly in a cell or =Quarterly or Use those names in formulas
See docs
Here's a screenshot. I created a sheet called constants and typed 12 and 4 in 2 cells. I've named the first cell Monthly and the 2nd cell Quarterly
Then in Sheet1 I can reference those names in forumla

or you can do it directly like:
=IF(A1 = "Monthly"; 12;
IF(A1 = "Quartly"; 4; ))

Related

Google Sheets - get the right-most / last non-empty value of a row from imported sheet

I have a sheet which imports data from a different sheet.
I inserted the sheet ID of the imported sheet in cell A1 to make it easier for me.
I need something that I can give a ROW and it will always return the right most / last non-empty value. That is, it automatically updates whenever we add a column in the imported sheet.
I've found this formula to show the last value of row 9 of the same sheet:
=FILTER(9:9,COLUMN(9:9)=MAX(FILTER(COLUMN(9:9),LEN(9:9))))
But I'm struggling to show the last value of row 9 of the IMPORTED sheet. How can I connect this formula with the imported sheet, that means with the Sheet ID (inserted in my new sheet in cell A1)?
Thanks a lot!
Assumes the relevant row number is entered in A2. Ugly but might be good enough:
=index(indirect("Sheet!"&row(A2)&":"&row(A2)),MATCH(1E+100,indirect("Sheet!"&row(A2)&":"&row(A2),1)))
Replace Sheet as appropriate.

find corresponding cell depending on other cell

I'd like to get the value of a cell depending on the value entered in another cell. I have different sheets in my workbook :
Sheet 1: One with a list of people and adresses
Sheet 2: One with a list of orders from these people
In Sheet 2, when I choose a client's name from the dropdown list (created via data-validation list with sheet 1), I'd like his address to display automatically in another cell (same row, different column).
Is there a way to do that ?
Thanks in advance !
A simple vlookup will do this. Assuming you have the dropdown in A2 of Sheet2, put this in Sheet2 in the column you want the address in. If you have a dropdown in each row, drag the formula down:
=iferror(vlookup(A2,Sheet1!A2:B4,2,false))

Google sheets - is it possible to enter a formula in a cell, using the data from the same cell?

In google sheets, is it possible to enter a formula in a cell, using the data from the same cell?
Not directly. But you can have a duplicate sheet, with the duplicated sheets referencing the other one with the proper formula for any change you want.
For example you want an updated 'view' sheet (B)for some other user that also change some value based on the data you have on your sheet (A) but you dont want them messing with your Sheet (A).
The solution is to create a sheet B that references sheet A , for example by using IMPORTRANGE if you want to just show information, or the a formula that involves referencing data from your sheet A.
The answer is really simple : no. Because of a really simple algorithm :
1 - Target cell formula's parameter and go to step 2
2 - If a targeted cell changed go to step 3 else finish the treatment
3 - Evaluate the formula, display the value into the cell and finish the treatment

How to show range of cells from one sheet in another with formating

I have a document with several sheets.
Each sheet has a range of cells (on the same row, spanning multiple columns) that are specific to that sheet (sheet "description").
I want to make a "table of contents" sheet that shows the name of each sheet and next to it, show the above mentioned range of cells as they are in each sheet.
I've tried with =ARRAYFORMULA(Sheet1!C2:AJ2) and with =IMPORTRANGE("sheet-ID"; "Sheet1!C2:AJ2"), but both of them brin in just the cell data, not their formating.
The formating includes: cell merging, font, background color.
How could I mirror on the "Table of contents" sheet, the "description cell range" of each sheet?"
This is not possible by using formulas. Instead you should use copyTo(Range) or copyTo(destination, options) methods from Google Apps Script.
I know its too late, but for new visitors.
You can use sort function. Simply add a sorted column to your range. Then sort the whole range again on your new sheet by the new column.

how Name a Cell in google spreadheet and use by name on a formula?

I want to declare a specific cell with a name, suppose, example B1 as "DolarValue", and reference in other cells by the name "DolarValue", let's say in cell C1 = value of "DolarValue" * content of B1 cell, let's assume that want a multiplication, how do you do that in Google Docs SpreadSheet ?
Thanks in advance !
Click on the cell you want to name, open the Data menu, click Named ranges.
On the sidebar, click Add a range, type a name for your range and click Done.
Then, in the spreadsheet, you can use that name rather than the cell reference, eg:
=DollarValue*A1

Resources