Want to index/match just the unique row - excel

I have a sheet with multiple parts belonging to different affiliates and areas. I want to write a formula that brings up the unique part from this list. I created a formula for the data set to get the row number of each unique part as shown below:
I want to just pull the rows from G which began with a 1. I try using the formula below, but it just will pull all the rows in column A:
INDEX(DATA!$A:$A,MATCH(1&"-"&$A$2&"-"&DATA!A2,DATA!G:G,0))
And produce this result:
01949765
01949765
04581664AA
04581664AA
04581914AC
04581914AC
04581914AC
04581914AD
04581915AB
Below is what I want to see:
01949765
04581664AA
04581914AC
04581914AD
04581915AB
Any formula I can use to get just the unique values?

As I understand it, the row already split the unique values, you just have to pull anything in A that has a G counterpart starting with 1.
=INDEX($A$1:$A$8,AGGREGATE(15,6,((LEFT($B$1:$B$8,1)="1")*1/(LEFT($B$1:$B$8,1)="1")*1)*ROW(INDIRECT("1:"&COUNTA($B$1:$B$8))),ROW()-10))
You'll have to adapt the different ranges to your data and the "-10" at the end depending on where you put your result.

My proposal, add a column, put in
=COUNTIF($A$2:$A2,A2)
Then filter only the value = 1. You'll see the results straightaway..
about the parts name in G..
you can load it using index()+match() function. Eg =INDEX(G:G,MATCH(A2,A:A,0)) to 'load' it.
Hope it helps.

Related

How to Countifs with one column only counting unique values, and another counting all values except a specific one?

I need help with filling out a table. Here's a link to an image of the table and my sample dataset: https://ibb.co/hsyycCC
I have to count all items that are either Size L or S..
..thats assigned to their owner (John, Mark, Gina)..
..thats either Colored (Y/N)..
..that isn't tagged as "Keep"..
But I only have to count all the items with unique IDs (no duplicates)
I can do steps 1-4 with a Countifs function:
=countifs(B:B,"<>Keep",C:C,"Yes",D:D,"L",E:E,"John")
in cell H3 for example.
But I don't know how to integrate step number 5 to the formula! Can anyone help enlighten me? Thanks!
If you're allowed to add a helper column you could put in cell F2 and drag it down
=IFERROR(MATCH(A2,$A$1:A1,0),"U")
This would flag all the unique values with a U
in the helper column . Then in your COUNTIFS function, add the condition
F:F,"U".
There might be a fancier way to do it, but that will get the job done

Excel - looking for coincidence of two different values in two different columns and extract another column

I am trying to extract the value like what we can do with vlookup, but in this case it has to coincide with the value on two different columns.
I want to extract the values which match with the two columns in yellow.
Sheet1 (where I am looking for coincidence of two values)
For that I am using the formula IF(COUNTIFS(....)=1;"value that I am looking for"; no match)
But I donĀ“t know what to put on "value that I am looking for", because if I add directly the cell from the row, it delivers directly a wrong value.
Sheet2 (where I want to add these two values, and formula that I am testing)
If you have O365, you can use a combination of INDEX and FILTER function to do this
=INDEX(FILTER('Sheet 1'!$A$2:$E$10,('Sheet 1'!$A$2:$A$10='Sheet 2'!$B192)*('Sheet 1'!$E$2:$E$10='Sheet 2'!$C192),""),1,2)
You need to update the 'Sheet 1'!$A$2:$E$10 range according to your data.
Also note that this will return the 1st match of both Partner object and Value in Obj. Crcy row, even if there are multiple matches
Edit:
As suggested by #P.b in the comments below, you can also use:
=#FILTER('Sheet 1'!$B$2:$B$10,('Sheet 1'!$A$2:$A$10='Sheet 2'!$B192)*('Sheet 1'!$E$2:$E$10='Sheet 2'!$C192),"")

Vlookup function generating duplicate values, how can I fix this please?

Hy Every Body, I have two excel sheets name as "Blotter" and "Opportunity", I want to use "Vlookup" Function in Opportunity so that I can find out which opportunity is available in the blotter sheet. Please take a look at the Blotter sheet as under
In the Column B the Opportunities are available.
Now please look at the opportunity sheet.
In the opportunity sheet I am using this function.
=IF(D2 = "","",VLOOKUP(D2,blotter,10,0))
It working fine with first five rows but later it start duplicate the same value multiple time, because behind these cell on the blotter sheet the column B has Piad/place status instead of opportunity. So it duplicate the next opportunity. I have tried many tricks like match, index, but in vain.
I know it can be fixed. I have google it and also try to find it via youtube but unable to fix it.
I don't think it can be done without an intermediate column. The position of the next value in the lookup key depends on where the position of the last successful lookup was, so in a way the lookup chain is path dependent and I don't think you can build path dependency with any ease inside an Excel formula.
In the below example you get something akin to what I think you want by calculating how many spaces there are to the next valid lookup key in Column C, and then doing an Offset in column D. In column C I use an indirect which generates path dependency based on the sum of the cells above itself. You would need to apply similar principles to your example, should only need a single equivalent of my column C.
Formulas as follows:
Column C: =MATCH("OPP",INDIRECT("A"&SUM($C$1:C1)+2&":A50"),0)
Column D: =OFFSET($B$1,SUM($C$1:C2),0)

count unique values between defined range in column

I've got column which consist numbers of type 000.XX.XX
=COUNTIFS(temporary!$A1:$A200,">=000.11.35",temporary!$A1:$A200,"<=000.11.39")
this formula counts values between 000.11.35 and 000.11.39. But i want to count only unique values. How can I do this?
There is not a built-in function for this, as you can see from the several suggestions of how to accomplish this on the Office support site. If you can, you can switch to Google Sheets, and they have a "COUNTUNIQUE()" function.
As described at the link provided above, identify the unique items, either using a filer (this is static) or through repeatedly using the "FREQUENCY()" function. Then count the unique items in a separate step.
Lets say you have the data set in the first column, first you need to remove the repetitions in a second column with the following array formula (confirm the formula with Ctrl+Shift+Enter)
=IF(SUM((A2=$A$2:A2)*1)>1,"",A2)
this formula lists only unique values
I would remove your first 4 digits of your string to create a float number and then count it with the following array formula:
=SUM((IF((RIGHT($B$2:$B$14,4)>=RIGHT(G3,4))*(RIGHT($B$2:$B$14,4)<=RIGHT(G4,4)),$B$2:$B$14,"")<>"")*1)
Please look at the two images for clarification
view with formulas
normal printscreen

Excel - Conditional row from an array to COUNTIF from VLOOKUP

I don't know if I'm going about this the wrong way but it seems like it should be simple. Column A has a list of Names. Along each row is several "W"'s. Another separate field has a drop down representing Column A names. I want to count the number of "W"'s in a row corresponding to what name I select. I've tried using VLOOKUP and COUNTIF but I can't figure out how to select the entire array and then single out the one row that matches my selected name. I can get it working with a bunch of IF statements but thats far too time consuming as I'm manually matching the name to the row (and it isn't future proof).
There are a few ways to first 'narrow in' on the row you're looking for, after which point you can use a simple COUNTIFS to check the number of W's in that row.
One method would be to simply use INDIRECT, and create the row reference on the fly, like so [assumes your search cell is C1]:
=COUNTIFS(INDIRECT(MATCH(C1,A:A,0)&":"&MATCH(C1,A:A,0)),"W")
This first uses MATCH to find the appropriate row, and then builds a reference to that row [like "24:24"], which becomes the row that INDIRECT passes to COUNTIFS, which counts that row for W's.
For only one use of INDIRECT, the high computing costs of INDIRECT should not be an issue.
Another method would be to point out the full possible box that data could be contained in [let's assume that at most only column H would be used], and then use INDEX to give us the appropriate row number, like so:
=COUNTIFS(INDEX(A:H,MATCH(C1,A:A,0)),0,"W")
This again uses MATCH to find the row which contains the value found in C1 within column A. Then it takes the full possible box from INDEX, and returns all columns from the particular row [note that telling index to return 0 for the column # actually returns all columns instead].
Other methods would be possible [for example OFFSET], but I believe these two show the principle fairly well.
You could use the "Helper" Column method:
In the helper column:
=COUNTIF(B2:H2,"W")
Then use SUMIF() in the totals column:
=SUMIF($A$2:$A$9,K2,$I$2:$I$9)

Resources