I've been given a badly formatted sheet where there are thousands of records with X and corresponding Y value in the following row rather than the same row and next column.
Is there a function that will allow me to copy altering rows?
So...
A2 goes into B2 and A3 goes into C2
A4 goes into B3 and A5 goes into C3
etc
A sample sheet is in https://docs.google.com/spreadsheets/d/1fB2rpVdJiTmp96sjGZiIYvKxEL9DLiK7W7QU8-4AN3A/edit?usp=sharing
I'd prefer a Google Sheet solution but excel is fine as well.
delete everything in B2:C range and try:
={FILTER(A2:A, A2:A<>"", MOD(ROW(A2:A), 2)=0),
FILTER(A2:A, A2:A<>"", MOD(ROW(A2:A)+1, 2)=0)}
Related
I am trying to perform an index and match formula in Excel with a two large datasets which will return multiple unique results.
I have illustrated a simplified version of the data below. The two match conditions are A1 in table 2 = A:A in Table 1 and B2 in table 2 = B:B in table 1. This will result in multiple results and I want a formula I can drag from cells C3 across to D4 in table 2 to show the results of this index and match.
Table 1
First Name
Second Name
Food allergy code
Bob
Johnson
03
Bob
Johnson
04
Table 2
First Name
Second Name
Food allergy code 1
Food allergy code 2
Bob
Johnson
03
04
I have used the formula below which returns the first match, but when I drag this from cell C2 to D2 it returns the same value. I'm not sure how to rewrite this formula so that it provides each unique Food allergy code given both match conditions are met.
=TRANSPOSE(INDEX(Table1!C:C,MATCH(1,(Table1!A:A=A2)*(Table1!B:B=B2),0)))
Any help would be appreciated.
You could use the following, but it is computationally rather inefficient, so if you want to drag this formula over many cells, you should leave a comment to find a computationally more efficient solution.
=TRANSPOSE(FILTER(D:D,(B:B=G4)*(C:C=H4)))
which looks like this in an example:
Is it possible in google sheets to write a formula that calculates the cell to fetch based on the value of another.
In this case i would want cell B2 to print the value of e2 so be something like:
='a2'2
Is this possible in google sheets?
try:
=HLOOKUP(A2; E1:F2; 2; 0)
Please see the link to my Google Sheet.
Google Database
This is an image from my 'Planning' sheet:
In cell A6 of the 'Planning' sheet is a name that is selected by dropdown sourced from column A5:A17 of the 'Qualifications' sheet.
In cell B2 of the 'Planning' sheet is a dropdown and the dropdown data is sourced from row J4:AF4 of the 'Qualifications' sheet.
Cell B6 of the 'Planning' sheet is to contain the formula.
This is an image of my 'Qualifications' sheet:
Depending on the value selected in the dropdown and the name in column A of the 'Planning' sheet, I want cell B6 of the 'Planning' sheet to return the contents of the cell in the range 'Qualifications'!A5:AF adjacent the name e.g. if the dropdown in A6 is set on David Bowie and 3465 is selected in B2, I want cell B6 to return '29/03/2019'. I'm just not sure about the formula and would appreciate some help, please.
delete those green cells and paste this in B6:
=ARRAYFORMULA(IFNA(VLOOKUP(A6:A, Qualifications!A5:AF,
MATCH(B2:H2, Qualifications!4:4, 0), 0)))
In B6 please try:
=offset(Qualifications!A1,query(arrayformula({row(Qualifications!A5:A14),Qualifications!A5:A14}),"Select * where Col2='" & A6 & "'")-1,query({transpose(arrayformula(COLUMN(Qualifications!B4:G4))),transpose(Qualifications!B4:G4)}, "select Col1 where Col2='" & B5 & "'",0)-1)
I have a table of data, a selection of which look like:
BARC 0.0001 0.0003 0.0006 0.0012 0.0009 0.0010 0.0008 0.0024
BNP 0.1915 4.1915 0.2314 0.3147 0.3168 0.3300 0.3060 0.4277
CSGN 0.1915 0.0003 0.2221 0.0104 0.0109 0.0124 0.0097 0.0152
The data in each cell are linked to a separate worksheet which share a name with the names in the first column. Each entry in the table for each column references the same cell but in a different worksheet. So B1 is BARC!G850, B2 is BNP!G850, and B3 IS CSGN!G850. The references are the same for each cell besides the worksheet name, but they don't increase incrementally across the rows; C1 IS BARC!G858 and D1 is BARC!G863, for example.
I want to use a formula to automatically populate the table instead of typing out the worksheet name references by hand. How can I do this?
Using the INDIRECT function you can reference a worksheet based on the text in ColA.
A | B | C
BARC | =INDIRECT( A1&"!G850") | =INDIRECT( A1&"!G858")
etc.
Use the formula =INDIRECT($A1 & "!G850") and copy that down column 1. For other columns you use the respective cell reference.
You can make it a bit more dynamic to include a row at the top in which you specify the exact cell reference to use in the formula for each column.
The formula should then read something like =INDIRECT($A1 & "!" & B$1)
This will allow you to simply copy the same formula to all cells and it will use the sheet name from the first column and the cell reference at the top to lookup the correct cell from the correct worksheet
I have SQL 2008 (not R2). I would like to have a matrix report where user can select one of the SQL resultset columns to be the matrix column group..
For example
A B Value
a1 b1 10
a2 b2 20
a3 b2 30
So the possible matrices could be (user selects from dropdown with A, B).
By A
a1 a2 a3
Value 10 20 30
By B
b1 b2
Value 10 50
This question should solve your problem. It is a way to use a parameter to refer to a field in your dataset.
i havne't actually done anything like this before, but i have a theory that you can modify the expression on the group to have an iif statement to change which field is grouped on
so, for the column group, change the expression for the gorup to something like =iif(ParameterValue=1,Field1,Field2)