Data
I have a table B3:F7 with a changing range, more or less rows and columns.
Objective
I want to Rotate the original table using the input from the drop down I2:M2 to get the result like 90, 180, 270 Rotation.
To clarify
I don't want to choose between them; I want the original table to be Rotated according to the input of the dropdown. I have only the original table and the data is mixed and the range is growing.
The formatting is for demonstration only.
Progress
I tried transpose twice =TRANSPOSE(TRANSPOSE(B3:F7)) to get 180 result, but the output is reverted back to the original form B3:F7.
Sources
Make a copy
try:
=ARRAYFORMULA(IF(I2=O3, B3:F7,
IF(I2=O4, TRANSPOSE(SORT(B3:F7, ROW(B3:F7), 0)),
IF(I2=O5, TRANSPOSE(SORT(TRANSPOSE(SORT(B3:F7, ROW(B3:F7), 0)), ROW(B3:F7), 0)),
IF(I2=O6, SORT(TRANSPOSE(B3:F7), ROW(B3:F7), 0), )))))
Related
I have a terrible formula that looks like this:
=if(B17="Yes",B$7)+if(C17="Yes",C$7)+if(D17="Yes",D$7)+if(E17="Yes",E$7)+if(F17="Yes",F$7)
I'd also like to be able to expand it if I go longer than column F.
Basically, other people can change their own row, in this example row 17, but there are many many rows just like it.
https://docs.google.com/spreadsheets/d/1YKCaGKVmiqfJQz9RcLiLOFXVpUqScNXcYOkPVSOVKz4/edit?usp=sharing
try:
=INDEX(IFERROR(1/(1/SUM(IF(B17:W17="yes", B$7:W$7, )))))
update
or delete everything in Y17:Y and use this on Y17:
=INDEX(IFERROR(1/(1/MMULT(IF(B17:W="yes", B7:W7, 0), SEQUENCE(COLUMNS(B:W), 1, 1, )))))
Action item tab:
Column A - Score - is based on calculations from the columns F-N
I want to assess the score according to the following range and assign the task in column B from a drop down menu.
Minor update 89-50
Localize 49-20
Major update 49-20
Merge 49-20
No action item 90-100
Redirect 0-19
It is important to keep the dropdown menu since the data is going to be checked manually and the status might be changed.
So generally speaking, I want to implement 2 steps:
Automatically to range the data and assign the status
To have the possibility to change the status manually.
I tried to implement it through Data Validation and simply failed.
https://docs.google.com/spreadsheets/d/1WsnAQPrrL2o4me55ghVaQHx2ZE9aisgbEIDtG6HQFn4/edit?usp=sharing
First of all, three of your ranges are conflicting, it will still work but will always get the first one which is "Localize". You should update the ranges for Localize, Major update and Merge so they don't have conflicting ranges.
Conflict:
Formula (A4):
=ifs(and(A4 < 90, A4 >= 50), "Minor update",
and(A4 < 50, A4 >= 20), "Localize",
and(A4 < 50, A4 >= 20), "Major update",
and(A4 < 50, A4 >= 20), "Merge",
and(A4 <= 100, A4 >= 90), "No action item",
and(A4 < 20, A4 >= 0), "Redirect")
Just drag the formula onto the cells below (e.g A5-A9). I am not using Arrayformula as it will fail if you modify a cell within its range.
Output:
Modifying F5 and G5 (Extracted data) to 0:
Note:
You can have formula on top of your Data Validations
I modified your Data Validations for column B into from =Legend!$A$2:$B$7 to =Legend!$A$2:$A$7 since we only need the action items, not the range.
You can still manually change your column B values BUT it won't automatically update ever again after manually changing it unless you copy the formula again to that cell and it will overwrite your manual input and go back to automatically updating based on the column F-N values.
These changes were already applied to your sheet, kindly check if it meets your expected output.
I have a bunch of data being pushed in a google sheet row by row. Each row has a reference number (COL A) and a date (COL D). For every reference number, I want to find the latest updated row. It's necessary that this is done by arrayformula.
So far I have a combination of arrayformula and filter. However it doesn't work as expected as one of the filter arguments is A2:A=A2:A. Obviously this is always true. What I want it to do is compare A2:A=A2 for row 2, then compare A2:A=A3 for row 3 etc. Without dragging down. Since the data is growing automatically
=arrayformula(if(len(A2:A),max(filter({D2:D},A2:A=A2:A)),))
https://docs.google.com/spreadsheets/d/16pbGiisFcsrHfrFKowzzkpw03Lw79yACjut96xxyWW4/edit?usp=sharing
try in E1:
={"Last Update";
ARRAYFORMULA(IFNA(VLOOKUP(A2:A; SORT({A2:A\ D2:D}; 2; 0); 2; 0)))}
You can paste this either of this formulas in F2 and then drag it down.
=QUERY($A$2:$E,"SELECT D WHERE A = '"&A2&"' ORDER BY D desc LIMIT 1")
=ARRAYFORMULA(MAX(FILTER({$D$2:$D},$A$2:$A=A2)))
*Edit:
Try this formula in F2 and there is no need to drag it down:
=ARRAYFORMULA(IFERROR(VLOOKUP(A2:A,QUERY(QUERY($A$2:$E,"SELECT A, max(D) WHERE A <> '' GROUP BY A"),"SELECT * OFFSET 1",0),2,FALSE),""))
You'll probably have give column F a date format, but it's a one time thing. Good luck :)
I'm using the below array formula to count the unique occurrences of text in column C using the agent name in column G as the reference. This is giving me multiple issues.
=SUM( --(FREQUENCY(IF(G3:G100000 = J5,MATCH(C3:C100000,C3:C100000,0)),ROW(C3:C100000) - ROW(C3) + 1) > 0))
Depending on the data set I'm using multiple agents will return a #N/A result and I can't figure out why.
Each dataset I'm using is 20k to 30k lines, so the formulas take a long time to process.
Any ideas how I could do this faster or better? Also any ideas why some agents get bad returns?
I am assuming that you are looking for the number of unique combinations of columns C and G.
Create a pivot table and check the box to add this data to the data model.
Drag both column headers to the Rows section, also drag one (of those same two) into the the values section.
click on the the field in the values section > value field settings > summarize values by > choose Distinct Count. This removes all duplicates.
Click the Row Labels filter and uncheck the blanks.
You can drop in new data then right-click on the pivot and refresh to see the new results. See the image.
I'm having trouble writing a VLOOKUP to sort some data.
I have one table that has data that looks like this:
MarkAsOfDate MaturityDate ZeroRate
05-May-15 05-May-15 0.006999933
05-May-15 06-May-15 0.006999933
05-May-15 05-Jun-15 0.008996562
05-May-15 06-Jul-15 0.008993128
... ....
I want to make a table with every instance where the interval between the dates in the first and second columns is exactly one month (such as 05 - May - 15 and 05 - Jun - 15), and with blanks where no such value exists.
So I made a second table which looks like:
MarkAsofDate MaturityDate Zero Rate 1M
5-May-15 5-Jun-15
6-May-15 6-Jun-15
7-May-15 7-Jun-15
8-May-15 8-Jun-15
9-May-15 9-Jun-15
.... ....
I want to populate this table using data from the first table. I've tried to write a VLOOKUP for it but I'm not sure how to do it with two columns instead of one.
Thanks in advance.
Vlookup has some limitations, as you're starting to see. Another suggestion is Index/Match. Use this in your second table.
Note: I assume your top table is in Sheet1. Put this in your C2, in the second table (under the "Zero Rate 1M" header):
=Index(Sheet1!$C:$C,match(A2&B2,Sheet1!$A:$A&Sheet1!$B:$B,0)) and enter by pressing CTRL+SHIFT+ENTER.
There are a lot of ways to do it - if your data is sorted first by MarkAsofDate and then by Maturity date, the simplest method will be to add a helper column on your raw data tab - let's say column E. In column E, starting at E2 and copied down, type [Assuming MarkAsofDate is column A & MaturityDate is column E]:
=IF(MONTH(B1)-MONTH(A1)=1,A1,"")
This column will show the MarkAsOfDate for every item which has a MaturityDate 1 month after the MarkAsOfDate; for all other rows it will show "".
In your special data results tab, use the MATCH function to find the row in column E which matches your current row's MarkAsOfDate. We will also use the INDEX function to return the value from that row in column C. Assuming your first sheet with raw data is sheet1 and your special data results is on sheet2, type this into E2 on sheet2 and drag down:
=INDEX(Sheet1!C:C,MATCH(A2,Sheet1!A:A,0))
Another alternative (apart from BruceWayne's recommended Array Formula) would be to use the OFFSET function. OFFSET creates a new range based on a starting point, moving a number of cells to the right/left/up/down, for a given height and width. In this case, we will first use MATCH to find the first time that the MarkAsOfDate on Sheet1 matches Sheet2. We will use that info and the OFFSET function to create a new range which starts there, and ends at the bottom of your data, like so:
=OFFSET(Sheet1!A1,MATCH(A2,Sheet1!A:A,0),1,COUNT(Sheet1!C:C),2)
Then we just need to use VLOOKUP on the range we created above, like so:
=VLOOKUP(B2,OFFSET(Sheet1!A1,MATCH(A2,Sheet1!A:A,0),1,COUNT(Sheet1!C:C),2),0)
This second alternative avoids needing a helper column, but is more complex and could be prone to errors if your rows/columns change (because we had to hardcode a couple of things in the OFFSET function). Also, OFFSET is volatile, meaning it recalculates whenever any cell calculates, so it can slow down your workbook if you have a lot of rows of it. Based on that, I recommend you either use the helper column method above, or if you are comfortable with Array Formulas, using BruceWayne's answer.