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

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.

Related

Is there a way to calculate a ratio using SUMIFs?

I am trying to get cell I13 on sheet MONTHLY STATS - SPREADS to populate a 0 if there have been no L's to count between the dates of 1 Oct 21 and 31 Oct 21 on sheet SPREADS LOG.
But I only want this 0 to populate if there is data present in cell H13. If there is no data in H13I would like I13 to be blank. (note I cannot use a number format to hide these 0's in cell I13 as I am trying to average the complete I column )
Whilst it is doing this cell I13 must also be able to run the COUNTIFS & SUM formulas shown below.
This is the current formula in cell I13 :
=IF(SUM(COUNTIFS('SPREADS LOG'!P:P,{"L"},'SPREADS LOG'!R:R,">="&DATE(2021,10,1),'SPREADS LOG'!R:R,"<="&DATE(2021,10,31)))=0,"",SUM(COUNTIFS('SPREADS LOG'!P:P,{"L"},'SPREADS LOG'!R:R,">="&DATE(2021,10,1),'SPREADS LOG'!R:R,"<="&DATE(2021,10,31))))
If someone could tweak this formula, that would be great.

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

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:

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.

vlook up for multi combination value

Friend.
I have sheet1 like below
Jan Feb Mar Apr
A 10 15 13 10
B 11 11 15 12
C 12 13 15 14
D 12 10 10 15
In Sheet 2! i have 2 scroll scroll down list in cells made by data validation.fist one is in A1 with the values A, B and C, in A2 cell with the values Jan,Feb,Mar.
What i need on this, if i select A and Jan from scroll down list. i need to show the value as '10' in A3 Cell
I tried VLook up with my limited knowlege but i can provide only one value in Lookup value and array.
Please help.
You have to provide vlookup a number of column to return as variable, which you may get as a return value of match function.
Sheet1 has populated range A1:E5, where first row contains names of months (range A1:E1). Sheet2 has only values in two cells A1 and A2.
You need to find in which column of Sheet1 is a month, that is done by
match(a2, Sheet1!A1:E1, 0)+1
and find the value with VLOOKUP.
The final formula would be
=vlookup(a1, sheet1!a1:e10, match(a2, sheet1!A1:e1, 0)+1, false)
EDIT: The first time I messed Sheet1 and Sheet2.

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