Adding the sum of best 5 of 7 cells - excel

So I have tried to use sumproduct to pull data from cells. My issue is that I would prefer to pick 5 individual cells vs a bank of cells.
I can make this formula below work, but it pulls "Place" cell values into the equation as well as "Points" value cells
Image of cells and formula
I would like to use the formula
=SUMPRODUCT(Large(C5,G5,K5,O5,S5,W5,AA5,{1,2,3,4,5))
to pull only from the 7 specific cells, but I get an error. as soon as I enter large, it only has the first 3 cells highlighted.
The error states that You've entered too many arguments for this function.

I am new to the Large formula as well, but it can only accept an array, not individual cells. You did specify individual cells which would lead to the next argument.
Since the Large formula only excepts 2 arguments you have too many and it fails with an error.
It is not a nice solution, but I guess the formula could work if you put your specific individual cells in neighbouring cells to create the array needed for the formula. (Or at least refer to them in some other cells to create the Array)
For the result you also would need 5 cells to enter the Sumproduct formula to display in each cell the 5 individual results.
Similar to:
=SUMPRODUCT(Large(A1:A7,1))
Where A1:A7 would be the newly created array where you reference:
in Cell A1 =C5
in Cell A2 = G5
in Cell A3 = K5
etc.

The LARGE function expects a single contiguous range as its first argument.
This array formula should circumvent that restriction.
=SUM(LARGE(IF(MOD(COLUMN(C:AA), 4)=3, C5:AA5), ROW($1:$5)))

Related

Excel - Double press of the Fill Handle is filling to the end of column, not the end of adjacent dataset

Summary:
I am currently trying to fill a formula to a whole column in Excel to the end of an adjacent dataset (A2:A14500). Instead of the usual behaviour where Excel will flash-fill it to the end of the dataset in the adjacent column B2:B14500 for example, it instead flash fills it to the whole column (B2:B1048576), even past the end of the dataset in column A.
Use Case:
Column A is just a =FILTER command to pull from another sheet, excluding the blanks (in my live sheet, cell A1 is =FILTER('Raw'!A:A,'Raw'!A:A<>""). All other columns contain headers in cell 1:1. Cell B2 contains a basic 2 part =IF statement with an error catchall: =IF(ISERROR(VLOOKUP(A2,'Lookup'!A:B,2,FALSE)),"No",IF(VLOOKUP(A2,'Lookup'!A:B,2,FALSE)="Error","Yes","No"))
In my current example, the =FILTER in column A produces 14500 rows of data. I am attempting to use the fill handle to populate B3:B14500 with the =IF statement currently in cell B2. When I double press the fill handle, it fills the whole column of B3:B1048576, which causes Excel to crash (I am trying to do the same for 32 columns (B2:AG14500), so it is flash-filling over 33 million formulas instead of 600K).
Expected result when double clicking flash handle in formula column:
Data
Formula
1
Yes
2
Yes
3
No
4
Yes
Actual current result when double clicking flash handle in formula column:
Data
Formula
1
Yes
2
Yes
3
No
4
Yes
No
No
No
No
No
Final Comment:
Usually, when double pressing the fill handle on a formula in column B, I'd expect it to match the end of the dataset in column A (If column A contains data in cells A2:A100, I'd expect double pressing a formula in cell B2 to copy that formula to B2:B100, not B2:B1048576).
I know that copy-pasting is an option, as is manually dragging the fill handle down, but this involves me using weird Ctrl/Shift/Arrowkey combos to select the right range (this is supposed to be user friendly by others who don't use Excel much), or a long time holding the fill handle as there's 14K rows of data. Additionally, I am aware of Home>Fill>Down and Data>Flash Fill but neither of these work for me (Fill Down replaces the formula in B2 with the header in B1 and only copies down to B2, and Flash Fill tells me it can't see a pattern, despite providing it 1/2/5/10 cells of example data).
Any assistance with understanding why the double-click fill handle isn't working (I suspect it's due to the way it handles the =FILTER in column A), or how to overcome this would be appreciated. Currently using MSO365. Thanks!
PS. The reason I haven't filled the formulas manually is the number of cells in column A will change for each report generated with this spreadsheet, so the number of cells it needs to populate will vary.
=IF(ISERROR(VLOOKUP(A2#,'Lookup'!A:B,2,FALSE)),"No",IF(VLOOKUP(A2#,'Lookup'!A:B,2,FALSE)="Error","Yes","No"))
Adding # to the cell range that results in the spill will reference the whole spill. In case of lookup it'll spill the result of the lookups from the first to the last of the cells from the spill range.
PS since you own Office 365 you might want to look into XLOOKUP instead of VLOOKUP. XLOOKUP already has an embedded value if not found.

Insert a formula from another sheet based on same cell values

I have a master workbook with two columns: names and formulas, which are specific for certain names. Generally, there are some 300 different names and 10 different formulas. What I need is to insert that formula in another sheet when some of this names appear - some kind of vlookup formula which won't give me value but formula.
And second part of a problem is how to make this formula (if it can be somehow inserted) dynamic and use relative values for calculation from same row in calculation sheet....
Please see my simulation below. My formula is F3 (ignored = sign) and its name is Name1. For test purpose, I typed 7 into cell F3 and 8 into cell F4.
With the formula below I typed in sheet2, I am able to call the formula of =F3 and change the reference given to cell F3 to F4 and reach to result of 8 in master sheet.
=INDIRECT("Master!"&SUBSTITUTE(VLOOKUP("Name1",Master!$I$3:$J$10,2,FALSE),"3","4"))
Maybe you can solve your puzzle by using functions I used in above simulation (INDIRECT and SUBSTITUTE).

How to define excel SUMIFS criteria considering any text and numbers?

My SUMIFS formula criteria is based on a cell (say A1) that is data validated by list and changed via selection by user. If cell has data inside text or number by selection from drop down list, SUMIFS formula is considering that data as criteria to calculate the related sum. If criteria cell is left blank, I want formula to sum everything without any condition. My problem here; in criteria field of SUMIFS formula, I typed if condition like; SUMIFS(sum-range,criteria_range,IF(A1<>"",A1,"*")) but in this case excel considers only text values and do not include cells containing number. Briefly, if nothing selected in A1, I want SUMIFS formula to sum everything without any condition, numbers, texts and even blank cells. How can we proceed to do that?
EDIT:
Here an example for data and formula, what is expected is actually to disable criteria if one of selection is blank on left. Harun's suggestion works but if there is blank cell in criteria range, then in this case it won't consider those values in sum. For instance, if we select from left Phone/smart/touch, then how can we get "2" as output no matter what is in cri_range4 cells? Thanks
Example:
How about this solution? It basically ignores a missing entry in column C and evaluates only the other two. (Your example formula has a fourth criterium that isn't apparent in your list but the method can be extended for as many criteria as you might have.
=SUMPRODUCT((IF(LEN(C2),(INDEX(Lists,,1)=C2),TRUE))*(IF(LEN(C3),(INDEX(Lists,,2)=C3),TRUE))*(IF(LEN(C4),(INDEX(Lists,,3)=C4),TRUE))*SumRange)
For better readability I created a named range Lists which comprises your sample range E2:H10 while I named I2:I10 as SumRange'. INDEX(Lists,,1}` refers to the first column of the range. It's important that SumRange and Lists have the same number of rows.
If A1 is blank then just use not equal operator to sum all cells that are not blank. Try below.
=SUMIFS(D1:D5,C1:C5,IF(A1<>"",A1,"<>"))
Edit: can you check below formula in D3 cell then drag down.
=IF(C2="",SUM($I$2:$I$10),SUMPRODUCT(($E$2:$H$10=C2)*($I$2:$I$10)))

Copy the Excel RANK formula without changing the end reference

Suppose I have a simple spreadsheet with 3 rows of data that I want to rank in separate columns. The example I will use is simple, but my actual dataset is 12k + rows. In this simple example, I want to use the RANK formula from Excel to do this. To rank the values in column Police, I'll use the formula =RANK(B2, B2:B11, 1), with B2:B11 being the range.
As I mentioned, my actual dataset has thousands of rows and many more columns to compare. Even in this example, I want a simple way to copy the formula to all of the other _RANK column cells. If I simply copy the cell to the other cells, +1 gets added to the cell value. This is what I want to happen, EXCEPT for the ending cell of the range.
As you can see above, this is incorrect. The formula gets set to =RANK(B11,B11:B20,1) for cell E11, when what I want is =RANK(B11,B11:B11,1). How can I easily copy this formula across multiple cells so that it is has the correct formula?
Placing $ before the cell references makes it static. Try changing your formula to Rank(B11, B$2:B$20,1). Coping this formula will only change those references which are not proceeded with $.

Distinct on Excel between 2 Sheets

i have single file excel with 2 sheets :
-Sheet1
Column A : {1,2,3,4,5}
-Sheet2
Column A : {2,5}
my question is, how to display numbers not in Sheet2 from Sheet1?
so the result numbers is {1,3,4}
thanks!
There are many ways you can do this, the simplest is to use Vlookup all the way down the column of one sheet to determine if the same value exists in the other sheet. (Thus creating a "Difference" flag). You can then use excel filters on the sheet to either keep what matched or remove it.
I can demonstrate using two column on a single worksheet. You should have no trouble transcribing this to two worksheets for your own purposes.
As an array formula¹ in D2 (empty or column header label cell above first cell with formula is required),
=INDEX(A$1:A$5, MATCH(0, IF(ISNA(MATCH(A$1:A$5, B$1:B$2, 0)), COUNTIF(D$1:D1, A$1:A$5&""), 1), 0))
Add error control with the IFERROR function and fill down as necessary.
  
¹ Array formulas need to be finalized with Ctrl+Shift+Enter↵. If entered correctly, Excel with wrap the formula in braces (e.g. { and }). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.

Resources