I am having an issue to find the magic ArrayFormula
Here is my request. Suppose I have a Sheet1 like this with RequestIDs and MDM_Keys getting the LOGS of MDM Request. This table is filled with forms and new rows are added automatically
RequestID
MDM_Key
MDM_Attr01
MDM_Attr02
R001
A
A
EUR
R001
B
B
USD
R001
C
C
JPY
R002
A
A Name1
EUR
R002
B
B Name1
USD
R003
C
C Name1
BRL
R004
A
A Name2
EUR
I would like to create a Sheet2 to get the last status of my MDM, meaning
NbOfRequest
LastRequestID
MDM_Key
MDM_Attr01
MDM_Attr02
3
R004
A
A Name2
EUR
2
R002
B
B Name1
USD
2
R003
C
C Name1
BRL
Probably I need to create an additional column in Sheet1 to concatenate RequestID and MDM_Key
Anyway, I am not able to find the ArrayFormula to get the LastRequestID.
Thank you for your advices
I have created a public Sheet
https://docs.google.com/spreadsheets/d/1JDAP3DAw1ngb0_BRF75I-xWhZ0lyLdBfYnVAsUqSp9c/edit?usp=sharing
You can do this with a reverse vlookup.
Try:
=query({"NbOfRequest","LastRequestID",B7:D7;ArrayFormula({countif(B8:B,unique(B8:B)),VLookup(unique(B8:B),sort({B8:B,A8:A,C8:D},row(A8:D),0),{2,1,3,4},0)})},"where Col2<>'#N/A'",1)
Related
I have one sheet that has IDs for which I'd like to pull information about from another sheet.
Sheet 1 with IDs:
Id
A
B
Sheet 2 with additional information:
Id
Amount
A
$500
A
$600
A
$700
B
$200
B
$300
B
$400
C
$30
C
$40
C
$50
I would like returned all information from Sheet 2 that matches all the IDs in Sheet 1. The result I want:
Id
Amount
A
$500
A
$600
A
$700
B
$200
B
$300
B
$400
I have tried using =FILTER(Sheet2!A:B,Sheet1!A2=Sheet2!A:A) but that only gets me the first ID:
Id
Amount
A
$500
A
$600
A
$700
I've played around with changing Sheet1!A2 in the filter formula to Sheet1!A:A but that throws an error. How can I get information for all IDs? Help!
Try FILTER() with COUNTIFS().
=FILTER(Sheet2!A2:B,INDEX(COUNTIFS(A2:A,Sheet2!A2:A)))
FILTER()
COUNTIFS()
You can try with FILTER and REGEXMATCH:
=FILTER(Sheet2!A:B, REGEXMATCH (Sheet2!A:A,TEXTJOIN("|",1,Sheet1!A:A)))
I currently have a table with five columns:
A = Campaign
B = Person
C = Opportunity Name
D = Total Cost of Campaign
E = Date
I'm trying to use =sumifs to calculate the amount in column D only if: (1) it matches the exact value in cell H2 to column A, (2) the date range, in column E, is greater than the value in cell I2, and (3) it removes duplicates based on value in column C (so you can't sum if value appears more than once).
Please refer to my data table (also attached) as reference:
Campaign Person Opportunity Name Total Cost of Campaign Date
A Bob Airbnb 5000 3/2/2017
B Jim Sony 10000 3/2/2017
B Jane Coca-Cola 10000 3/2/2017
C Jim Sony 200 3/2/2017
B Daniel Sony 10000 3/2/2017
B April Coca-Cola 10000 3/5/2017
How could I do this?
Thanks in advance for the help!
Try:
=SUM(
UNIQUE(
QUERY(A:E,"select C, D where A = '"&H2&"' and E > date '"&TEXT(H3,"YYYY-MM-DD")&"'")))
Query will cut first two conditions. Unique will remove duplicates:
I am trying to figure out how to query values from Sheet2 into Sheet1 where column A in Sheet1 matches column A (strings) in Sheet2, and return only the max value of column D (integer) from Sheet2.
Here's what I am using:
=Query(Sheet2!A:F,CONCATENATE("Select D where Name =",A2))
I have tried using Select max(d)... and =MAX(Query(...)) but neither worked for me.
What would be the correct way to do this?
Example data:
Sheet1
Name ColB Date Check Oldest
Bob Y 2/14/2013 4/14/2013 5
Sheet2
Name Title Date Age
Bob Foo 2/1/2013 3
Boo Bar 2/4/2013 5
This may serve, if entered in the cell presently containing Oldest (which would then be overwritten with max Age:
=query(Sheet2!A:D,"select max(D) where A ='Bob' ")
but the result for your sample would be 3 rather than the 5 as shown to be required.
Hi have something how this.
COLUMN_NAME
------------
NAME1
NAME2
NAME3
NAME1
NAME1
NAME4
NAME2
I want to get the most repeated value from this colum, on this case, NAME4, any can help me? I tried some query functions but I dont understand the correct logic for this :S
First of all, if I'm not mistaken in the above example the most repeated text is "NAME1", since it occurs 3 times.
I'm sure that there is a better solution for the problem, but I only figured out this:
=index(query(A1:B8,"select A,count(B) where B ='' group by A order by count(B) desc",1),2,1)
NOTE: The quotes after B ='' are two simple quotes, not double quotes!! At that point we are comparing the B column with the empty string.
Supposing that:
The raw data should be in A2:A8 cells (NAME1, NAME2, NAME3, ...)
There is an "extra" column we use, next to A (column B). All cells should be empty.
The above formula first runs a query (see the QUERY function inside) in which we count the occurences of each text and we are ordering by the count number in descending order. We will get something like this:
Column_name count
NAME1 3
NAME2 2
NAME3 1
NAME4 1
Then - with the index function - we get the cell value which is in the 2nd row and 1st column of the result of the query. This will be always good, because we always sort (=order by) the query results in descending order. So the most repeated text will always be in that position.
So it's a workaround, not that pretty, but works.
Hope it helped anyway.
I have the following Google Sheets data:
Name1 Name2 Name3 Value
A B C 20
B A C 30
C D F 40
What I'm trying to do is see if a specific name appears in any of the three name columns. If it does, then sum all the values in the "Value" column for all matching rows.
For example, I want to sum all of the values for name "A". That name only appears on the first two rows, so it should do 20+30 to give me 50. If I change the searched name to "C", that appears in all three rows so it should sum all of the numbers: 20+30+40. The algorithm needs to adjust and search appropriately.
=DSum will work
With the example you give use
=dsum(A1:D4,D1,{A1;"A"})+dsum(A1:D4,D1,{B1;"A"})+dsum(A1:D4,D1,{C1;"A"})
You can swap the "A" for a Cell reference
see https://drive.google.com/previewtemplate?id=0As3tAuweYU9QdEVHdTFHNzloSTY4LVYxdW9LdHRHbEE&mode=public#