I have to sheets within a workbook. On sheet 1 I there is a date that is the LOOKUP criteria(cell B9). I need to look in Sheet 2 and if the falls between the dates in Columns A and C...if so, then lookup the info in columns D thru K and populate the cells (E10 thru E16) on sheet 1.
I currently used the following formula in cell E10 in sheet 1...
=LOOKUP(2,1/((DATEVALUE($B$9)>='AUSSIE Wkly'!$A$3:$A$500)*(DATEVALUE($B$9)<='AUSSIE Wkly'!$C$3:$C$500))
But nothing comes up as you can see. Please help.
In your example, you want to retrieve values in row 4.
In Sheet1, cells E10, E11 you would use
=INDEX(Sheet2!$D$3:$D$500,SUMPRODUCT((Sheet2!$A$3:$A$500<=Sheet1!B9)*(Sheet1!B9<=Sheet2!$C$3:$C$500)*(ROW(Sheet2!$A$3:$A$500)-ROW(Sheet2!$A$3))))
=INDEX(Sheet2!$E$3:$E$500,SUMPRODUCT((Sheet2!$A$3:$A$500<=Sheet1!B9)*(Sheet1!B9<=Sheet2!$C$3:$C$500)*(ROW(Sheet2!$A$3:$A$500)-ROW(Sheet2!$A$3))))
You could put together similar formulas for the other cells.
I take the opportunity to stress the power of SUMPRODUCT, quite often more flexible and comprehensive than: 1) Array formulas, 2) Lookups, 3) COUNTIFS, 4) SUMIFS.
I am leaving here for those interested a few links showing that.
Better than COUNTIFS
COUNTIFS with ISNUMBER and multiple criteria
Have COUNTIFS ignore all blank cells (= empty cells and cells containing "")
Multiple lookups
Searching an excel with two search words (multiple lookup) using vba macro
Multiple-column based lookups in Excel
Finding rows with multiple values in the columns
On two questions related to yours
Excel: Counting how many rows fall within a time period
How to calculate results and plot data depending on results of a specific column in excel?
(and you are welcome here, which shows I am actually "fond of" SUMPRODUCT).
Related
In my worksheet in column F I have a list of names, that may appear or disappear according to other inputs in the spreadsheet. I want the cells in the columns G:AZ to remain blank if the corresponding cell (i.e. same row) in column F is also blank. Because I have thousands of cells to which I need to apply this, I'm using Pullover's Macro Creator to add this small change to all the formulas inside the cells really quickly, so I can do entire columns in seconds. In column J, for example, I've been applying this formula:
=IF(COUNTBLANK(INDIRECT("RC[-4]",0))=1,"",[this part changes and doesn't matter])
You can see that I need to change that "-4" to different numbers according to the column I'm working on. But I have so many columns that it's still going to be a pain to change that hundreds of times.
My question: Is there a formula I can use in the COUNTBLANK function that can reference the corresponding cell in column F without needing any changes in different columns and different rows? And since the INDIRECT formula is so volatile (I still don't know what that means, but I guess it's bad), is there a solution that doesn't use this formula?
I have thousands of entries for the same site names taken between different days. However not all row labels are identical. I just want to select all row labels that are shared among both spreadsheets based on the names contained in column A for example and copy them to a new sheet. Filtering and selecting wont work, theres thousands and different entries between the two. I just want to delete entries that are not shared among both spreadsheets.
I looked through other forums using vlookup but I am not sure i understand the syntax:
e.g. i looked at this forum: Matching two columns from two spreadsheets and grabbing data from one of the spreadsheets
it proposed this solution: =index(sheet2!B1:B3;match(sheet1!G1;sheet2!A1:A3;0)). So this solution join row from 2nd sheet to row first sheet. If column G 1st sheet and column A 2nd sheet are the same then you can use this to match. Place formula in column H 1st sheet. With this formula you will fetch data from column B 2nd sheet to column H 1st sheet.
I dont think this is the case since the positions of similar row values in both columns differ. I just want to know what labels are shared among both and delete entries that dont share those names
example of output
Yes vlookup is the key because if you lookup something in spreadsheet1:colA to see if it is in spreadsheet2:colA if it is not present you will get a null value. Then you can filter out these nulls to get only the list of rows which share the column A value in spreadsheet2. You will also need to repeat this in spreadsheet2.
For context, assuming the image you posted covers cells A1:C6, and your highlighted cells are A4:C5 then:
In sheet1 cell D3 put =VLOOKUP(A3, Sheet2!A:A, 1,0) and copy down for the rest of column D, and in sheet2 cell D3: =VLOOKUP(A3, Sheet1!A:A, 1,0)
IF the vlookup finds a match, this will give the exact same value in columnD which is present in both spreadsheets, otherwise it will give #N/A. Then you can filter those out.
(By the way the syntax for the sheet name depends on whether you have spaces in the name so Sheet1!A:A but 'Sheet 1'!A:A, I usually get these by highlighting them so excel does the work of naming the worksheet).
A side note, I would drag both worksheets into one file, you certainly can perform vlookups between different files, but this then relies on the exact file path so if you ever move either file, the vlookups will break and give you errors. I only ever vlookup within the same file.
I have two spreadsheets...Days and Visits. The first spreadsheet (Days) contains Name/Date. The second spreadsheet (Visits) also contains Name/Date. I am trying to get a formula that if the name and date appear on both spreadsheets that a value of "Yes" is returned on the Visits spreadsheet.
This is the formula I'm using but the Yes/No column an say "No" but I can clearly see some names should say Yes.
{=IFERROR(INDEX('Physician Visits'!$A$2:$F$800,MATCH(1,IF('Physician Visits'!$A$2:$F$800=A2,IF('Physician Visits'!$A$2:$F$800=C2,1)),0)),"No")}
Any help would be most appreciated!
Because of the way you have written your formula you are trying to find to different values in the same cell. The two IF's iterate together and since the ranges in the criteria are the same the cell in which you are looking are the same. And one cell cannot equal two different values at the same time.
There is a better way, use COUNTIFS()
=IF(COUNTIFS('Physician Visits'!$A:$A,A2,'Physician Visits'!$F:$F,C2),"YES","NO")
This assumes your comparing column A to Column A and Column C to Column F. If different ensure your are comparing the correct columns to one another.
I have three columns for each month. I need to average the value in the third column of each month for the last three entries. Can I write a formula that will select the last three entries in the designated range and calculate the average.? And to do this for multiple rows where the data may not be in the same columns?
My level of skill in using Excel is very limited, but I am trying to learn, I would very much appreciate any help that may be forthcoming.
You can use the AVERAGE() function in a cell on the same row. The arguments for the function will be the cells you wish to average.
Can be a series of cells (A1,B1,C1....) or a range (A1:C1). If you use cells from all over the spreadsheet. The copy function uses the relative position by default.
Once you have the function working in a particular row, you may copy that formula down to the other rows in the spreadsheet. Excel will automatically change the formula to include the corresponding cells from the same row the formula is being copied to.
For additional info on this function, visit:
http://office.microsoft.com/en-ca/excel-help/average-function-HP010062482.aspx
I have a worksheet in Excel 2013 with two sheets: Sheet 1 and Sheet 2. I am applying a formula in both the sheets in the same column (G). The data is in more than 100,000 rows that's why I can't put it in one sheet only.
The problem is that I want to use VLOOKUP in both sheets in a way that the function looks up in both sheets in the same columns (arrays) i.e. A and B columns in sheet 1 and sheet 2 and get the value from column B i.e. column 2 within VLOOKUP function.
How can I add reference to the other sheet?
I doubt a complete solution is possible with VLOOKUP because, for instance, the corresponding ColumnB values may differ even where a ColumnA value is the same on both sheets. So without VBA (or possibly merging your sheets) you may have to compromise, so I offer only a partial solution, based on Excel 2007.
This 'looks up' in the 'other' sheet and only defaults to the 'same' sheet where the first attempt is unsuccessful. It uses INDEX and MATCH because likely quicker than VLOOKUP for high volumes. The formula I have applied for Sheet1 (in G1 and to be copied down) is:
=IFERROR(INDEX(Sheet2!B$1:B$6,MATCH(E1,TwoArray,0)),INDEX(B$1:B$7,MATCH(E1,OneArray,0)))
where the OneArray and TwoArray are named ranges for parts of ColumnA for the two sheets and the link values are expected in ColumnE (the formula in Sheet2 is similar):