Copy values from the same row after filtering out a column for unique values? - excel-formula

Need to copy values from the same row of an excel sheet after filtering out the column for unique values.
Date P.O. #
060719 13
060719 13
060719 13
061519 11
061519 15
061719 16
061719 16
061719 16
Date P.O. #
13
11
15
16
I used the advanced filter to copy the values from column PO# to copy to another location (below) using the "Unique records only" filter. I would like the dates to follow. Anything with the same PO# will be guaranteed to have the same date, for example all PO# 13s will all be 060719, but not the other way around.

Use the same advance filter to return the dates:

Related

Create UI to filter and aggregate in Excel

I have a long excel containing dates and many value columns. I would want to create a dynamic filter where the user can input a date range in two cells and the values from each column will be filtered by the date range and an aggregated value calculated from the filtered values will be shown.
For example in the table:
Row year weight_pounds gestation_weeks
1 2005 6.0627122049999995 38
2 2006 7.12534030784 40
3 2007 7.4406013425 39
4 2008 3.30032006214 43
5 2009 7.1099079495 41
6 2010 7.31273323054 40
7 2010 9.31232594688 42
I want to filter by year 2007 to 2009 and show the average on both value columns in the sheet.
How can I approach this in excel? I have no experience to VBA but I am open to VBA if it is required.
Define a helper column that tests whether the row is within the required date range and filter based on that column.
Suppose the start date is in X1 and end date is in X2. And suppose your main data table starts with the heading Row in A1.
Then the formula in D2 might be something like =and(B2>=X1,B2<=X2)
Copy that formula down the whole list to give a column with TRUE and FALSE values
Turn on filters on the heading row
Select just TRUE in the helper column
For the average you can either use =SUBTOTAL(101,C:C) (the 101 parameter says to give the average of the rows that are still visible) or =AVERAGEIFS(C:C,B:B,">="&X1,B:B,"<="&X2) (which works regardless of how the main data table has been filtered.

Excel - Remove duplicates and SUM at the same time

I have a column with ID's, but they are duplicated; for instance:
"0,0,1,1,1,2,3,3,4,4, ... "
For each row, I have a given value in the other columns, for instance:
"0-24; 0-36; 1-13; 1-34; 1-23;..."
I want to keep only one row with each ID but I need to sum the values of each ID, that is, sum all the values in all columns for a given ID (0,1,2,...), which may include several rows.
Is there a easy way to do this using Excel?
Here is some sample data (table to the left) together with the desired output (tables to the right).
ID Value ID Value
0 24 0 60
0 36 1 70
1 13 2 16
1 34 3 24
1 23 4 48
2 16
3 9
3 15
4 24
4 24
What you can do is to copy your IDs and paste them for example in another Sheet. Let's assume your original table is in Sheet1, and you copy all your IDs to column A in Sheet2.
Then you remove duplicate IDs in Sheet2:
Select column A > Data Ribbon > Data Tools > Remove Duplicates
In column B, you then put the formula:
=SUMIF(Sheet1!$A:$A, Sheet2!$A2, Sheet1!$B:$B)
Note: above formula goes into cell B2 on Sheet2, and you copy it down with pasteSpecial > only formulas.
Edit: if you still want the same number of rows etc because of the information in your other columns, just skip the "Remove duplicates"-part.

excel formula to extract dates with highest trade count

I need excel formula to show the dates when the trade count was maximum. Below mentioned are the excel columns
trade count. date
10 9 jan
12 8 jan
12 7 jan
Result : 7 jan & 8 jan
so the result can be highlighted in two different rows. or whatever convenient format.
kindly advice how it can be done easily.
Let your column C provide you with all the dates on which the MAX happens. You can always hide column C later.
Let C1 be the maximum from column A:
=MAX(A:A)
Now in each row, column C can build up your final output string. Copy from C2 down:
=IF($C$1=A2,TEXT(B2, "dd mmm"),"")
This gives you a column of either blank values, or the dates you need (correctly formatted as text).
Use column D to build up your final output string, by looking down column C:
=IF(C2="",IF(D3="","",D3),IF(D3="", C2,D3&" & "&C2))
Your result string will be given by cell D2.

How to fill up data table from different sheet basing on column value?

I am trying to incorporate such a workbook that contains large datatable in one sheet and different input sheet. As per header column's cell value, I want to fill up the database from input sheet. It is as below:
Sheet Database Sheet Input
Date Data Date Data
. 12 May 14 45
.
.
.
10 May 14 16
11 May 14 85
12 May 14 45
13 May 14
14 May 14
15 May 14
.
.
.
.
While I am using the Data Column Cell's formula as an example in Cell B2 of "Sheet Database" sheet like:
IF(A2='Sheet Input'!$A$2,'Sheet Input'!$B$2)
Only the cell beside the date that matches with the input sheet, gets the value from the input sheet. The scenario is as follows:
Sheet Database Sheet Input
Date Data Date Data
. 12 May 14 45
.
.
.
10 May 14 FALSE
11 May 14 FALSE
12 May 14 45
13 May 14 FALSE
14 May 14 FALSE
15 May 14 FALSE
.
.
.
.
But I want to persist the value once available. That means, I want to enter data from Input sheet and the database sheet should keep the value once it was entered. Input sheet may vary to data, but the previous data should be in the database sheet.
I know very well that this code will not be able to achieve my aim.
I am brainstorming, but could not find any way to do so. Can anybody please help me in this regard?
Note: I shall not use macro/VB. I solely want to be dependent on the built in functions of Excel.
If I understand you correctly, you're looking for a simple VLOOKUP. Something like the following formula in the data column of your Sheet Input sheet should do the trick (Assuming the data column is column B and the Date column is column A and Date and Data are headers in row 1):
=VLOOKUP(A2,'Sheet Database'!A:B,2,FALSE)
This function is essentially looking for the value in cell A2 from Sheet Input in column A of Sheet Database and then returning the value in column B that corresponds to the value it was searching for.
If you want the cell with the formula to be blank in the event that the value is not found in the database, you can wrap your function with an IFERROR function as follows
=IFERROR(VLOOKUP(A2,'Sheet Database'!A:B,2,FALSE),"")
Good luck.

Excel formula to get last entry in a row

I have a sheet where each row begins with a string identifier, followed by a series of values for each week since the sheet was created:
XXX 15 20 25
YYY 11 15 19
ZZZ 18 22 22
On another sheet I would like to have some of the string identifiers from the first page (not all), and only the latest value for that item:
XXX 25
ZZZ 22
I actually want multiple sheets of the second kind, with each string id possible appearing on more than one sheet.
I can't use VBA as this has to be viewed (and values added and altered) on my Windows Phone 7 (I do not believe the mobile version of excel supports VBA, but correct me if I'm wrong). Is there a formula that's able to do this?
The value of the last non-blank cell in ROW range
=LOOKUP(2,1/(A1:M1<>""),A1:M1)
on your master sheet you should designate a hidden column like ZZ to contain the formula: =LOOKUP(2,1/(A1:ZY1<>""),A1:ZY1) this will put in column ZZ all the LAST values of that specific row
on all of the other sheets that depend on your master, you can use a vlookup to retrieve the information in ZZ from the master sheet

Resources