Excel showing a set of rows based on a specific value - excel

I have a sheet as below
I want my output to show
In short: How do I filter rows based on val1 and show all column1 data?
I want to show all column1 values where column2 has val1 as one of its values.

You can use the Advanced Filter
Criteria formula:
=OR(COUNTIFS($B$8:$B$17,$B$2,$A$8:$A$17,A8),A8="")
The A8 = "" is there so blank rows will be included
B2 contains the val you wish to filter on.

Related

Sum the values that are in the same columns in excel

I want to sum the values that are in the "Time" columns but return 0
I tried the following formula:
=SUMIF(C2:H2,"Time*",C3:H3)
=SUMIF(SCRATCH031342[#Headers],"Time*",C3:H3)
Sum Up Numbers As Text
For the first row of data, you could use
=SUMPRODUCT(--(LEFT(C$2:H$2,4)="Time"),VALUE(C3:H3))
or
=SUMPRODUCT(--(LEFT(SCRATCH031342[#Headers],4)="Time"),VALUE(C3:H3))
and copy down.
Additionally, if you'll write the results in the same row as the table row (e.g. in cell J3), you should simplify the table version with:
=SUMPRODUCT(--(LEFT(SCRATCH031342[#Headers],4)="Time"),VALUE(SCRATCH031342[#]))
You can use:
=SUM(INDEX(C3:H4,0,MATCH(C6,C2:H2,0)))
and fill in cell C6 with the desired column name

Select a subset of excel Table given a value of given column

I have a Table in excel like the following one:
col1 col2
A 1
B 0
A 2
B 2
B 3
I was not able to find a way to select a subset of the table like this one using an excel function.
col11 col22
B 0
B 2
B 3
based on the value "B" of column col1 or just be able to select the col22' from the given subset.
I would like to have a solution that does not require to VBA nor array formula. I found on Internet the function FILTER, but it is not available yet and Structured References does not have such functionality.
I would like to use for example the result col22 as a column at another place of my spreadsheet. Other languages such as R, provide a function subset that does this in a pretty simple way. In excel it is really easy to filter using the Excel interface (filter button), but I am not aware of a function that does something similar programatically.
I had the same problem and the only thing I found on the internet was the FILTER function too.
I wanted to vlookup a subset of a table based on another column. My solution was to make another column that is the concatenation of the two. Then I used vlookup on this column.
I don't know what are you going to do with the subset table that you want to have. But you can do it in a different way as I did. May it helps.
Assuming col1 is A and col 2 is B and your result set's col1 and col2 are E and F respectively, try this formula in column C: =IF(A2=$E$2,MAX($C$1:C1)+1,0)
Now, in cell E2 (i left the first row for a header), i physically typed "B" to make this the input source and allowing for dynamic reporting. for as many cells below that as you wish, the following formula will only show the total number of "B"s that are in your input source: =IF(ROW(A2)>MAX(C:C),"",E2) Notice i did not fix the cells with $ as your following row depends on the former.
Cell F2 (the top of your col2 field for the result set) include: =INDEX(B:B,MATCH(G2,C:C,0)) and in G2 put: =IF(E2="","",G1+1) and copy both down as far as you have formulas in column E (or result set col1).
The reason for the IF statements is for formatting rather than displaying errors on failed lookups.
Goal: extract a subset of the current sheet only when values in the first column match a value in the first column of another 'Sheet1':
=VLOOKUP(A2,Sheet1!$A:$B,2,FALSE)
Add the formula above in the first cell of the first empty column, then sort Z-A this column and remove all "#N/A" rows, then re-order again A-Z the first column and remove this temporary column.

Select a single number from a group by comparing time stamps

I have an xlsx sheet (using MS Office 2010) with around 10-15K rows and multiple columns. I want to consider two columns to filter this data but need data from all the existing columns. Sheet looks like
The id column can have duplicate records. The rule I want to apply is:
1) For the set of duplicate ids in column id, select only 1 row which has highest value in corresponding timestamp column.
2) So as result this should give only distinct ids with hisghest timestamp among it's set of duplicate values.
3) Considering the data in the sheet, the result should have only two rows that I have filled in with yellow color.
Can you please help me on how to setup rule to do this in excel?
Sort by id then timestamp (descending). Add a new column after B and use
=COUNTIF(A$2:A2,A2).
Filter that column to show only 1's
Do a descending sort on Columns A and B and then use Remove Duplicates on Column A only. The highest values should be the first found, and anything else will be deleted.
Without sorting for a Range from A2 to A24 you can use:
=B2=MAX(B$2:B$24*(A$2:A$24=A2))
If you have any questions, just ask ;)

excel show rows having a value in any column

I have three coulmns
Column1 has values a,e,d
Column2 has values e,a,p
Filter has values a,x,y
Now on selecting filter value a in the Filter column the sheet should list two rows i.e. a,e and e.a
please let me know how to do that
I also want to filter rows by a value exist in a range of columns.
And I found a way:
Step1:
Add a new column (example: D), and use COUNTIF function to check if the value is exist in a range of columns or not.
Example: =COUNTIF($E3:$V3, "Value") > 0
Step2:
Just filter by column D, with the value TRUE
The only way to do it using a filter would be with a helper column
In C1, enter =A1&B1 or =CONCATENATE(A1,B1)
THen you can filter C using the text filter. If it contains "a"....
You can use an Advanced Filter - Data->Advanced
Say on sheet 1 you have:
Col1 Col2
e a
a x
p y
On Sheet two, write out:
Col1 Col2
a
a
(Note that's 3 rows total, 1 for the header, then the first a under col1, then the 2nd a under col2.)
Highlight the range you want to filter on Sheet1, click the Advanced button under the Sort and Filter section of the Data tab on the ribbon - click the Criteria button, navigate to and highlight the criteria you set up on sheet 2, and click Ok

Excel formula to output name in first column based on a value in the 3rd column

I have a data table with 8 columns and i want to know if anyone can help me come up with a formula to get the name in the first column if i enter a value into the columns (3,4,5,6,7,8).
I want the name from the first column to appear in another table on another sheet where only names appear where data is in the columns (3,4,5,6,7 & 8)
Try this:
=IF(OR(Sheet1!C2<>"";Sheet1!D2<>"";Sheet1!E2<>"";Sheet1!F2<>"";Sheet1!G2<>"";Sheet1!H2<>"");Sheet1!A2;"")
You can use C1 = 1 .... if you prefer.
And C1,D1,E1... have to be replaced with your columns.
Also Sheet1 have to replaced with your sheet name
I would use a Pivot tables.
First create a new column in the existing table:
If you only having positive values then it is:
=sum(C2:H2)
If you have zero and negative values as well it would be like this:
=IF(COUNTBLANK(C2:H2)=6;0;1)
Then make a pivot table with the "TO/TA name" in the Row Labels and the new column in Report filter - where you then removes the "0".

Resources