Index row formula error on Google spreadsheet - google-sheets

I have a formula in Google spreadsheet from cell B2 all teh way to B100 which is
B2=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(1:1)),0), "")
B3=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(2:2)),0), "")
B4=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(3:3)),0), "")
B5=iferror(INDEX(DB!$B:$AC,SMALL(IF(DB!$B:$AC=$A$1,ROW(DB!$B:$AC)),ROW(4:4)),0), "")
..
...
......
So it is pulling up values from a second tab which is named as "DB".
The Index row formula looks for the status "Completed" ( which is on cell A1) and return the details for all completed from the DB.
Google spreadsheet
main spreadsheet
Database in tab 2 (DB)
DB
The formula works fine , however i am getting duplicates of every cell which got the status "Completed "
Attached links to the screen shots for your reference.
Don't know what i am missing. 0_o
Thanks

I think you can use QUERY() for what you try to achieve.
Have a look at this example sheet and check sheet 2 where this formula is used to filter the data from sheet 1:
=query(Sheet1!A:H, "select * where B = '"&A1&"' ")
(where A1 is a drop down list with the values 'COMPLETED', 'in progress', 'resolving').
See if that helps ?

there is no need for formula here.
This is simply done by filtering:
Supposing you have a DB sheet like this
In your main sheet, put DB!A1 in cell A1, and drag and fill horizontally and vertically, to copy exactly your DB sheet into main sheet (you can do this selectively as well, there is no need to copy every column, just cpy those you want). Then click on FILTER, you can find it in SORT AND FILTER, then you will see a dropdown menu on all of the column headers. Simply by clicking on your status header, you can selected completed and press OK, it will ONLY show rows with completed on their status column.
And here is the link to download this example sheet

your links don't work for me.
You should use the FILTER() function, that is designed exactly for this purpose:
in cell A2 on your second sheet use: =filter('DB'!B:AC,'DB'!B:B=$A$1)
As suggested I would use Data validation with dropdown list, so that only valid statuses may be chosen.

Related

Sheet Query formula giving the incorrect output

I have a sheet where the query formula used is very simple.
Here is the test sheet
It just have to display the conetents of the second sheet in the first. Unfortunately, at some point the cell values are merged into single cells.
The example below shows till Apple1 to Apple 10 the data is merged in row 1.
I need a reason for this error and please avoid answering like, delete the row 15 of fruits tab sheet to correct.
Any cause for this is really appreciated.
Sheet2
Sheet1
QUERY has several arguments. If you don't include them, they are assumed to be defaults (with the third argument being to try to make the first row into a header). Try this instead:
=query(Fruits!A3:F,"Select *",0)
or you can leave the middle argument blank in your case:
=query(Fruits!A3:F,,0)

How to insert row with formula that links cell? Google Sheets API

The answer is next:
1) There is formula in Google Sheet cell "A11", for example "=F11+C11";
2) I append multiple data to this Google Sheet list with the help of
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchUpdate
or https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append
3) I need to append the value for "A12" using its current position. It had to become "=F12+C12".
Or if I append data on top
(as described here - Google sheets API append method (last on top))
I need that formulas under my append changed to correct value. If current value of "A11" is "=F11+C11" then,
if I add 3 rows before this row, it becomes "A14" cell and it's value had to be changed to "=F14+C14"
Is there any way to realise both this scenarious directly in Google Sheets API request? May be there is some settings in Google Sheet that can help me (something like formating of cells/columns etc)?
UPD. For now it all works fine except of that incident when formula returns exception! My questions is not actual for now, but I still not understand in which cases formulas will change and in which they will not.
The answer is quiet simple!
I update cell 'A13' with formula '=B2+C2' and as cells 'B2' and 'C2' stay on their places after every changes my cell 'A13' still link cells 'B2' and 'C2'.
But if I will add row before 'B2' and/or 'C2' then formula will change and my cell 'A13' will link 'B3' and 'C3'.

Google sheet formula that finds row name and returns column headers based on marked cells

I'm trying to return the column headers for a row that is marked with an x. The row is selected from a name in the left column. I'm stuck here.
I can illustrate what I want to do by showing these images:
Start table
The result I want is this:
Outputs of the possibilities for the first sheet
I have put more information in my Example Sheet.
Link to editable example sheet
This formula should create a table (with a single formula) with the months in one column and the headers in the second column.
=ArrayFormula({A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)})
If you'd want to 'lookup' the months you manually type in you can wrap the above in a vlookup. Example:
=ArrayFormula(if(len(L4:L); vlookup(L4:L; {A4:A15\ substitute(transpose(query(transpose(if(B4:G15="x";B3:G3&char(10);));;rows(A4:A15)));" ";)}; 2; 0);))
You can check out both formulas in the copy of the sheet I've made in the spreadsheet you shared.

Autofill data until next value is reached (but miss out one row each time)

I have a student attendance data sheet in which I need each student's name to appear in Column A, but only where the row for that student contains a subject. As you can see, I'm nearly there. In cell A4 I typed:
=B3
and in cell A5 I typed:
=IF(B4="",A4,B4)
...then just autofilled down from there. However, cells A17 and A31 (where a new student name appears on Column B) are messing up a formula I have on another sheet that references Column A on this sheet. Therefore, I'd like to leave these particular cells blank if possible, but I'm not sure how to achieve this.
I duplicated the sheet in your shared spreadsheet and entered in cell A3 this formula:
=ArrayFormula(if(isblank(C3:C),,if(row(C3:C) <= max(row(C3:C)),vlookup(row(C3:C),filter({row(C3:C),B3:B},len(B3:B)),2),)))
that seems to deliver the expected output.
See if that works for you ?
I made another copy and entered this formula into A5: =IF(B5="", IF(B4="",A4,B4), "")

Google Docs: create drop down list using data from another spreadsheet

I need to populate a drop down list in a cell (let's say cell B2) of Spreadsheet A (using data validation) on basis of data located in Spreadsheet B (range - C3:C15).
How do I do that? Googled this for several hours - no luck.
Thank you.
Getting the items from another workbook, as opposed to another sheet in the same workbook is similar. It's a two-step process. First, you need to import the data you want to use for the validation items into the workbook where you want to make use of it, then connect it up as described in #uselink126's answer.
An example: Workbook 2 contains a list of fruit names in no particular order. The list has been assigned a named range Fruits for readability, but this isn't necessary. Workbook 1, Sheet 1 has a column of cells where we want to populate a drop-down with the items from Workbook 2.
Step 1 - Importing the data
Add another sheet to Workbook 1 and insert the following formula into cell A1:
=ImportRange("<key>","Sheet1!Fruits")
where <key> is the unique ID Google docs assigned when you created the spreadsheet. In the example, the items are sorted into alphabetical order as part of the import, and to do this you would enter instead:
=Sort (ImportRange("<key>","Sheet1!Fruits"), 1, true)
The 1, signifies column 1 is what to sort by, true means sort ascending. The cells in column 1 should populate with the sorted fruits.
Step 2 - Point the data validation to the imported list
On Workbook 1, Sheet 1, Select the cells you want to have the fruits as their drop-down data source.
- Right-click the selection and click on Data Validation from the menu. Set Criteria to List from a range and enter Sheet2!A1:A20
That's it. The drop-down chevrons should appear in those cells and when clicked the list of fruits should appear.
Note that this is "live" - adding an item of fruit to Workbook 2's list will also magically add it sorted in the drop-down list.
The format to access cells from another spreadsheet in Google Sheets is:
SheetName!CellAddress
For example, let's say you have a Google Sheet that contains 2 spreadsheets named: Sheet1 and Sheet2 (The names are listed on the tabs at bottom left hand side of each sheet).
In Sheet1 if you wanted to access cell B2 in Sheet2, you reference it by inputting: Sheet2!B2
In Sheet2 if you wanted to access cells C3:C15 in Sheet1 , you reference those cells by inputting: Sheet1!C3:C15
To specifically add cells from another sheet to a dropdown:
1) Select the cell you want the dropdown in
2) Right click on the cell and select Data Validation
3) In the dialog box, click the grid image in the Criteria input box
4) This will bring up the "What Data?" dialog box
5) Click on the tab for the sheet you want to access
6) Hold down shift and click on the cells you want to select (you will see the cell addresses show up in the input box in the "What Data?" dialog)
7) Click OK and you are set. The data will update if you make changes in the source sheet.
More info: https://support.google.com/docs/answer/186103?hl=en
Similar to rossmcm's answer but with a few tweaks because his answer didn't work for me:
=IMPORTRANGE(spreadsheet_url; range_string)
Where spreadsheet_url is The full URL of the spreadsheet from where data will be imported, and range_string a string, of the format "[sheet_name!]range" (e.g. "Sheet1!A2:B6" or "A2:B6") specifying the range to import.
Example:
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1EwEn_2dSbgAlR7jJ7UT_MyE3h1-Biq3qoovfIGUnVlo/edit#gid=0", "Sheet1!A1:A7")
More info from Google DOCS Help!

Resources