I am trying to recreate the output I get from this formula from a google sheet in excel.
So currently I have one sheet with a list of staff names in google sheets. Then in another sheet I am using the formula: =ARRAY_CONSTRAIN(ARRAYFORMULA('2 - Staff Listing'!D9:D300), 292, 1) to pull the list of names into a column in the new sheet.
I then used the formula: =ARRAYFORMULA(flatten(B5:B100&A1:J1)) and the output resulted in a column which repeats each name from the first column 10 times. The image below shows the output in google sheets.
Picture of Google Sheet Output
However, I have not found a way to do this in excel yet as it does not have a flatten() function. I have seen some things online about using dynamic array formulas to imitate the flatten() function but the examples weren't very helpful and I couldn't figure out how to implement in for my use case.
If anyone has any ideas for a formula in excel that can accomplish the same thing without extra helper columns for something like a Vlookup I would really appreciate it!
A way:
=IFERROR(INDEX(B2:B5,QUOTIENT(ROW(AZ2:AZ200)-2,10)+1),"")
In B2:B5 have names, you can modify ranges with necessary values.
edit
with SEQUENCE instead of ROWand counting names
=INDEX(B2:B5,QUOTIENT(SEQUENCE(COUNTA(B2:B5)*10)-1,10)+1)
Related
I need convert a sheet I built in google sheets to Excel 2016 since my team does not know google sheets. I wrote a formula to check multiple columns and then build a new array from any data in the selected columns. I understand filter is not available in Excel 2016 but unfortunately upgrading is not a viable option for the whole organization.
The formula I need help converting is
=sort({iferror(FILTER('3)ReAllocation Holdings'!$D$3:$E,'3)ReAllocation Holdings'!$D$3:$D<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$F$3:$G,'3)ReAllocation Holdings'!$F$3:$F<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$H$3:$I,'3)ReAllocation Holdings'!$H$3:$H<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$J$3:$K,'3)ReAllocation Holdings'!$J$3:$J<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$L$3:$M,'3)ReAllocation Holdings'!$L$3:$L<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$N$3:$O,'3)ReAllocation Holdings'!$N$3:$N<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$P$3:$Q,'3)ReAllocation Holdings'!$P$3:$P<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$R$3:$S,'3)ReAllocation Holdings'!$R$3:$R<>""),{"",""})
},1,0)
The filters checked all 8 columns for data and returned all data in the 8 columns and the column next to it. Then I was sorting the data since I was using an array litteral each column had to provide some data, so the iferror was providing blank,blank if the column was empty and then the sort put those to the bottom.
Any help would be greatly appreciated. I don't really know excel but I know google sheets really well so I'm open to any level of complexity for a solution.
I managed to get a similar thing as the stacking filter using AGGREGATE it will list all data if the left column contains a value:
(Enter with ctrl+shift+enter, copied down and one cell to the right)
=IFERROR(INDEX(D$1:D$5,AGGREGATE(15,6,ROW($D$1:$D$5)/($D$1:$D$5<>""),ROW($A1))),
IFERROR(INDEX(F$1:F$5,AGGREGATE(15,6,ROW($F$1:$F$5)/($F$1:$F$5<>""),ROW($A1)-COUNTA($D$1:$D$5))),
IFERROR(INDEX(H$1:H$5,AGGREGATE(15,6,ROW($H$1:$H$5)/($H$1:$H$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5))),
IFERROR(INDEX(J$1:J$5,AGGREGATE(15,6,ROW($J$1:$J$5)/($J$1:$J$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5,$H$1:$H$5))),
IFERROR(INDEX(L$1:L$5,AGGREGATE(15,6,ROW($L$1:$L$5)/($L$1:$L$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5,$H$1:$H$5,$J$1:$J$5))),
"")))))
I built it up to column L:L, but from there on you get the idea how the formula repeats and the COUNTA-range is stacked.
Also the row numbers need to be adjusted to your needs.
It does not have the SORT functionality, but I believe the reason you sort is to get empty lines your array creates sorted to the back? Anyway. If you want to get the outcome sorted it's better to use these as helper cells and use INDEX/AGGREGATE on the row number from small to large.
I am trying to create a google sheet or excel spreadsheet that can automatically calculate the price of a project. I am currently using =VLOOKUP to pull numeric values from a separate page. My issue is that I cannot figure out how to get the formulas to work the equation I want them to. I am able to reliably pull single values, but not add any other values with them to produce a total. I keep receiving a formula parse error. I tried using the following formula, but would not be surprised to find out I was way off. =SUMPRODUCT((=VLOOKUP(A3,PriceTable!A$2:B$5,2,0)*(B3+C3)+(=VLOOKUP(A3,PriceTable!G$2:H$5,2,0))))
I have included a link to the sheet as well as the basic equation I would like done. Any help would be greatly appreciated.
Link: https://docs.google.com/spreadsheets/d/1aT9NrsJUEIubiXCBDgZRNdddKtmPbFAt9opQS-f6FJ8/edit?usp=sharing
Equation I want done: (column names) A(B+C)+D=E
This is what was put into the sheet and it does exactly what I wanted. I am unsure of who the person who helped me is.
={"Total"; ArrayFormula(IF(A2:A="",,IFERROR(1/(1/(IFNA(VLOOKUP(A2:A, PriceTable!A:B, 2, 0))*(B2:B+C2:C)+IFNA(VLOOKUP(D2:D, PriceTable!C:D, 2, 0)))))))}
try:
=INDEX(IF(A2:A="",,IFERROR(1/(1/(
IFNA(VLOOKUP(A2:A, H:I, 2, 0))*(B2:B+C2:C)+
IFNA(VLOOKUP(D2:D, J:K, 2, 0)))))))
I'm working on a sensitive Excel file where I'm not allowed any VBA code, so I have to help myself with basic formulas in Excel. Please note that I am not allowed to add extra columns and the solution has to be in one single cell. What I have are two columns:
Column A has numbers from 1-10.
Column B has numbers from 1-10.
I'd like to know e.g. for all 3's in A, how many 5's are in B.
The result would be as well seen with the use of two filters, but I don't want to do this over and over again, since the size of the columns will only get bigger.
I tried to use INDEX-MATCH command in the COUNTIF, but it's not that simple. The main problem is to define how to look and search in each row and then count/sum/whatever.
Does anyone have any ideas?
Though a function not available in versions of Excel before 2007, it seems:
=COUNTIFS(A:A,3,B:B,5)
met the requirement here.
I need help removing blank entries from an Excel data validation list.
I’ve looked at various solutions, but in my implementation I am using dependent lists to drive several VLOOKUP, so none of the solutions I have found seem to work. As an Excel novice it’s difficult to work out which path I should be heading down, so I’d be grateful to anyone that could help out.
If anyone feels like a challenge and wants to have a look, my sheet can be accessed at: https://www.dropbox.com/s/b7lxe9oagzdaniy/MRF_Dashboard_v0.6.1.1.xlsm?dl=a
For your New list, in Raw!DL2 use this array formula.
=IF(LEN(DL1),IFERROR(INDEX($A$2:$A$99, MATCH(0,IF($A$2:$A$99<>"",IF($DK$2:$DK$99="",COUNTIF(DL$1:DL1,$A$2:$A$99),1),1),0)),""),"")
Array formulas require Ctrl+Alt+Delete to finalize. Once entered correctly you can fill down to Raw!DL100. This array formula produces a list of the numbers from column A where column DK is blank.
Similarly, the array formula for Raw!DM2 would be:
=IF(LEN(DM1),IFERROR(INDEX($A$2:$A$999, MATCH(0,IF($A$2:$A$999<>"",IF($DK$2:$DK$999="Pending",COUNTIF(DM$1:DM1,$A$2:$A$999),1),1),0)),""),"")
Fill down as necessary.
I'd like to know which column is the last column where the sum of the values of the row is smaller or equal to a given value. (Count the columns until a sum is reached.)
In Microsoft Excel the following array formula works just fine:
{=MATCH(7;SUBTOTAL(9;OFFSET(C1;;;1;COLUMN(C1:G1)-COLUMN(C1)+1));1)}
But Google Sheets always returns 1 as an answer:
=ARRAYFORMULA(MATCH(7;SUBTOTAL(9;OFFSET(C1;;;1;COLUMN(C1:G1)-COLUMN(C1)+1));1))
Is there some difference between Excel and Google Sheets array formulas that I'm missing?
If there is a difference is it documented somewhere?
Is there another way to implement this in Google Sheets (preferably without custom functions)?
Link to sample spreadsheet.
Is there some difference between Excel and Google Spreadsheet array
formulas that I'm missing?
The difference is how specific functions are supported in array formulae. In this case, you're out of luck on two counts: OFFSET can't be iterated over an array (ie it can't produce an "array of arrays" as it can in Excel), and the second argument of SUBTOTAL can't be iterated either; in Sheets, it must be an explicit range.
If there is a difference is it documented somewhere?
No, not that I know of.
Is there another way to implement this in Google Spreadsheet
(preferably without custom functions)?
=ArrayFormula(MATCH(7;SUMIF(COLUMN(C1:G1);"<="&COLUMN(C1:G1);C1:G1)))