Distinct on Excel between 2 Sheets - excel

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.

Related

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 $.

How to INDEX a through range of data and remove duplicates while using both MATCH and COUNTIF

I have a range of data that I would like to have a formula return the title column detail based on three criteria in other columns and not repeat the result. I have been able to use MATCH to set the criteria but have had trouble inserting COUNTIF into the formula to remove duplicates. In summary, I would like to combine =IFERROR(INDEX($B$2:$B$10,MATCH(1,($H$2=C$2:C$10)*($H$3=$D$2:$D$10)*($H$4=$E$2:$E$10),0)),0) and =IFERROR(INDEX($B$2:$B$10, MATCH(0, COUNTIF($G$8:G8,$B$2:$B$10), 0)),0). I have provided the data and the results from the two formulas above. Is it possible to combine the two formulas above to get the desired results shown below. Hopefully returning the data in sequence along the row is not causing issues.
Use AGGREGATE to return the SMALL row number and COLUMN(A:A) to increment the k argument.
=IFERROR(INDEX($B:$B, AGGREGATE(15, 7, ROW($2:$10)/(($H$2=$C$2:$C$10)*($H$3=$D$2:$D$10)*($H$4=$E$2:$E$10)), COLUMN(A:A))), TEXT(,))
With the new Dynamic Array functions (currently only available in Excel Insider Fast builds for some), this can be done with this formula:
=UNIQUE(INDEX(FILTER(B2:E11,(C2:C11=H2)*(D2:D11=H3)*(E2:E11=H4)),,1))
Mind you, this is just one formula in ONE cell. Nothing has been copied down. The formula automatically spills into the neighboring cells. If you want the results spread across columns, wrap the formula in Transpose()

Adding the sum of best 5 of 7 cells

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)))

Minimum column value if two other columns match

I have an excel file with data A, B & C.
I want to find the min of C but only if corresponding A=B.
How can I perform this operation?
You can accomplish this with an array formula¹.
=min(if(A2:A34=B2:B34, C2:C34))
Array formulas should never be full column references, If the columns of numbers grows and shrinks occasionally, apply the following to dynamically adjust the number of cells referenced.
=min(if(A2:index(A:A, match(1e99, C:C))=B2:index(B:B, match(1e99, C:C)), C2:index(C:C, match(1e99, C:C))))
¹ 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.

What is the difference between a shared formula and an array formula?

Excel defines shared formulas and array formulas. What is the difference?
My understanding is that array formulas are now obsolete. Is this true?
Is it possible to transform array formulas into shared formulas?
Look at section 4.8 of The Microsoft Excel File Format (PDF ref) from OpenOffice:
An array formula (BIFF2-BIFF8) and a shared formula (BIFF5-BIFF8) is a formula spanning over a range of cells. Array
formulas are handled different from single cell formulas in a spreadsheet. Shared formulas are only an optimisation to
decrease the file size, they are not distinguishable from other cell formulas. Naturally an array formula cannot be a
shared formula at the same time. Shared formulas are created for instance when filling a cell range from a single formula
cell.
In general an array or shared formula is stored only once in a file, either in the ARRAY record (➜5.4) for array formulas,
or in the SHAREDFMLA record (➜5.94) for shared formulas. These records are part of the Formula Cell Block
(➜4.7.2). They immediately follow the first FORMULA record (➜5.50) for this range20. All array or shared formula cells contain a reference to the formula data. This reference (tExp token, ➜3.10.1) consists of the cell address of the top left cell of the range. In this way each formula cell can be associated with its formula data.
If a formula returns a string value, a STRING record (➜5.102) follows the FORMULA record normally. In the case of
array and shared formulas, this STRING record follows the ARRAY or SHAREDFMLA record.
20 For shared formulas the first FORMULA record may not be the top-left cell of the range. It is possible to overwrite single cells of a shared formula range without invalidating the shared formula itself (the remaining formula cells).
Shared formulas are simply a more efficient means of storing formulas.
Array formulas add significant functionality and are definitely not obsolete. For example, the MMULT function can return multiple values. To get these multiple values into multiple cells you must use an array formula. Array formulas are entered into a range of cells by selecting the range, typing the formula, and then pressing CTRL+SHIFT+ENTER.

Resources