Dynamic sort top/bottom N values in excel 2019 - excel

I'm currently using excel 365 but need to make a spreadsheet compatible with 2019. I have a list of unique departments each with a specific volume of production. I need to create a dynamic filter for the bottom 5 producers, along with a vlookup alternative to get the values so I can graph them.
In excel 365 it's as simple as
Departments: =FILTER(Metrics!$B$2:$B$41,Metrics!$AL$2:$AL$41<E22)
Values: =IFERROR(VLOOKUP(D25#,Metrics!$B$2:$AM$41,37,FALSE),"")
The table goes from A1:A41 with row 1 being the headers.
I've tried using MIN and SMALL but can't figure out how to get more than one value. I'm open to but would prefer not to use VBA if I can help it.

For a function using SMALL, you'll have to use it in an array.
To do that, type out your formula, then instead of hitting enter like usual, press 'ctrl + shift + enter' to tell Excel to use an array. This will put {} around your formula to indicate it worked properly. From there just drag your formula down your desired amount of columns and should be good to go.

Related

Converting a Google Sheets Filter Formula to Excel 2016

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.

how to auto populate in excel written numbers

this is a very simple question, but I can not find a way arround it. I am working ona MATLAB project and I need to convert numbers from 1 to 1000 to the written form I.E(one, two, three, four...) since I do not know how to do this in MATLAB I was just going to autopopulate the numbers in MS Excel and import the data directly into MATLAB. My problem is I do not know neither how to autopulate numbers in their written form in Excel since it does not work as I would normally do. I.E :Typing one, two, three, four in separate cells; selcting the values and dragging until I hit 1000. Once I start dragging it just repeats the values over and over. I would appreciate if anyone could help me with this issue either in MATLAB or MS Excel. Thank you
To find the auto-populate lists in Excel, go to Options>Advanced>General>Edit Custom Lists
As you can see below, written form numbers are not included in these lists, which explains why they do not autofill when you drag down.
As pnuts alluded to in the comments, a good way around this in Excel would be to create a custom function that will generate a written form number for any numeral cell value. This has already been done by Microsoft support and is very easy to implement by pasting the code on this link into the Visual Basic Editor in your workbook. (credit to pnuts)
https://support.microsoft.com/en-us/help/213360/how-to-convert-a-numeric-value-into-english-words-in-excel
Once you've done that, you just put your numbers from MATLAB into column A, then paste this formula into B1 and drag down.
=SpellNumber(A1)

XIRR Formulae For each investment

I am trying to apply an XIRR Formulae so that the percentage of each investment is calculated separately. I attempted an IF formulea an was not successful. I need to amend the below formulae. This will be useful as i am trying to apply it to 200 invesmtents plus.
=XIRR(C2:C17,B2:B17)
Below is the data.
Below is the result i am trying to get.
There are some problems of your data setup. Here is how the IRR works (http://www.investopedia.com/ask/answers/022615/what-formula-calculating-internal-rate-return-irr-excel.asp). Without your data, here is how you can make this to work for matching different investments.
See the attached image below and assume you are entering the formula from cell F2 and here you go:
=XIRR(OFFSET($C$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)),OFFSET($B$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)))
Please note this is an array formula (need to click Ctrl + Shift + Enter together)).
What I did is to use OFFSET to find the pertaining ranges for dates and values of each investment. And here I have also showed you the results for a valid data inputs. Try and let me know.
pivottable can do it easily.It's not good for U?

Select Spreadsheet From Dropdown To Query In Formula

I have a pretty extensive spreadsheet that stores data over many years, and to help culminate that data I have a had to make multiple summary pages to calculate the data one for each year. I want to instead make a single sheet that will summarize the data and the user can simple select the year they want to view from a drop down menu and all the formulas will automatically calculate the new data. From what I can tell this can be done by using the "indirect" function but I cannot get it to work and am starting to think that function will not work because of the way the formula works. Does anyone have a working method that will generate the desired results.
Manual Formula
=SUMPRODUCT((MONTH('W.A.R. 2016'!$A4:$A369)>=1)*(MONTH('W.A.R. 2016'!$A4:$A369)<=3)*('W.A.R. 2016'!$A4:$A369<=TODAY())*(ISNUMBER(FIND("Work",'W.A.R. 2016'!B4:B369))+(ISNUMBER(FIND("Wrk/Lve",'W.A.R. 2016'!B4:B369))/2)))
Formula im working on.
=SUMPRODUCT((MONTH(INDIRECT("'("&O2&")'!$A4:$A369"))>=1)*(MONTH(INDIRECT("'("&O2&")'!$A4:$A369"))<=3)*(INDIRECT("'("&O2&")'!$A4:$A369")<=TODAY())*(ISNUMBER(FIND("Work",INDIRECT("'("&O2&")'!$A4:$A369")))+(ISNUMBER(FIND("Wrk/Lve",INDIRECT("'("&O2&")'!$A4:$A369")))/2)))
In theory I cannot see why its not working but I think it the way indirect pulls the data.
I can spot a couple of issues.
This has unnecessary brackets around the sheet name:
INDIRECT("'("&O2&")'!$A4:$A369")
It will produce a string like: '(W.A.R. 2016)'!$A4:$A369
You just want to use:
INDIRECT("'" & O2 & "'!$A4:$A369")
There is some inconsistency in your formulas
The first formula searches for "Work" in B4:B369 and "Wrk/Lve" in B4:B369, whereas the second formula has the ranges swapped around.
The best advice I can give on trying to figure out where a formula is going wrong is using the Evaluate Formula tool.
Select the cell that has the formula, go to the Data tab on the ribbon and click Evaluate Formula. It will pop up a dialog that allow you to step through each part of the formula as it calculates. From there you should be able to see what's going wrong.

(excel) sumproduct multiplying with another sheet

i have a little problem with final formulas in one of my column. How to start. maybe i will explain what i have a then what i want.
i have an excel worksheet with 3 sheets. i want to record goods and what are these goods made of. first is sheet called Goods where is possible to put number of goods i want to make. In this case i want to make 1x sandwich1 and at the same time 3x sandwich2. i dont want make sandwich3 this time.
Second sheet is Matrix sheet where I record every good and what it is made of. This sheet is basic sheet and all other sheets take list of goods (resp. ingredients) from this sheet. Simply when i want to make sandwich1 i look at matrix and know that i need 1x1pc of egg + 1x5g of cheese. And for 3x sandwiche2 i need 3x10g of sausages.
Final sheet is called Ingredients. It is a list of used ingredients from Matrix sheet (exactly same order) to make these sandwiches. I want to fill formulas into column B which would go through one ingredient ofter ingredient and count needed amount of it. So it would look into matrix in the same row and where there is some number it would multiply with number of items from Goods sheet. The list of goods is also in the same order as in the matrix sheet.
I hope you understand now what i want and will try to help me. I think there will be SUMPRODUCT, SUMIF and maybe INDERECT functions but i am not that skilled in excel
thanks for any suggestions
You can use MMULT function here - it's an "array formula" which you need to enter in a range. You can do that like this:
In Ingredients worksheet enter this formula in B2
=MMULT(Matrix!C2:E4+0;Goods!B2:B4+0)
[I'm assuming you have a European version of Excel where ; is used to separate arguments]
Now select the whole range B2:B4, press F2 key to select formula and hold down CTRL and SHIFT keys and press ENTER. This "array enters" the formula in the range and you should now see curly braces like { and } around the formula and also the correct results.
You cannot change part of that array now, only the whole thing
Note that I'm assuming that the contents of Goods!A2:A4 will be the same as Matrix!C1:E1 and in the same order. You can extend the ranges to be as large as you like as long as that principle still holds
I suspect that this is an issue of "when all you have is a hammer, every problem is a nail". For reasons known only to you you are using a spreadsheet to solve a problem that databases were made to do. Any solution to this problem in a spreadsheet will be entirely dependent on the integrity of your data - add another column or get things out of order and it will fail.
That said, what you have in your link is effectively a pivot table and what you need is the unpivoted version of this - the instructions for getting this are here.
When you have that, you can use the various database functions in excel to get your answer.

Resources