extracting a specific cell when specific column and row paramteres are met - excel

I have an excel spreadsheet that contains 16 columns and 100 rows. In each cell is a specific number.
The header columns contain specified numbers as do the row headers.
On a seperate sheet within the workbook is a calculator that people can input numbers to calculate engine perfomance figures.
What i am after is that when a specific number is inputed corresponding to a number in the header column, along with a specific number from the row header the number corresponding to the interestion of those two numbers will automaically populate in the calculator cell sheet.
I am very new to excel, and have had minimal experience in writing or inputting code.
Any assistance in this would be greatly appreciated.
Cheers
Andrew

I assume your data sheet looks something like this but with more columns and more rows. You can use a combination of VLOOKUP and HLOOKUP to achieve what you want.
In my example the formula in D11 is:
=VLOOKUP(D9,A1:F6,(HLOOKUP(D10,A1:F6,1,TRUE) + 1),TRUE)
You need to change the parameters of this to match your dataset, the user inputs in D9 and D10 and the product is displayed in D11.

The "standard" approach is to use INDEX with two MATCH functions based on column and row headers, e.g.
=INDEX(Table_without_headers,MATCH(Z2,row_headers,0),MATCH(Z3,column_headers,0))
where Z2 and Z3 contain the search values

Related

Formula to match two values between two worksheets

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.

How to populate specific rows in a sheet based on specific query or values of cells

I have like 3 different worksheet (3 different University names). And each sheet has 2 columns: Column A contains stream name and Column B contains names of student in that particular stream.
I want to make a 4th sheet where I want to write a query where on the values of 2 cells (i.e, 1st cell contains university name, 2nd cell contain stream name.) should give all the student name matching that criteria. Could you guys help me, this is kinda very imp. and please suggest can I do it using normal Excel formula or should I do it using VBnet.
Thanks a million.....:)
The formula I'm suggesting is:-
=IFERROR(INDEX(INDIRECT($A$2&"!B:B"),SMALL(IF(INDIRECT($A$2&"!A1:A1000")=$B$2,ROW(INDIRECT($A$2&"!B1:B1000" ))),ROW(1:1))),"")
where on my 4th sheet A2 contains the name of the university and B2 contains the name or number of the stream that you're interested in. Change A1:A1000 and B1:B1000 to suit the maximum number of students you expect to see on a sheet. You can use A:A and B:B instead of A1:A1000 and B1:B1000, but it will be rather slow if you do.
The formula should be entered in (say) C2 using CtrlShiftEnter and pulled down.

Sumif for dynamic range of columns

Hi I have store numbers in different columns and products in rows with sales for respective stores. I want to do sumif in a different sheet by changing stores and products in data validated cells. How do I select dynamic columns in Sumif based on store numbers. Attaching image for reference.
Here's a mockup based on your sample data, with row numbers and column letters shown:
Using that as a base, in cell C15 is this formula:
=SUMIF($C$3:$C$9,$C$14,INDEX($D$3:$G$9,0,MATCH($C$13,$D$2:$G$2,0)))
You'll need to adjust the ranges to suit your actual data.
=SUMIF(A2:A6,"=Shirts",B2:B6)
A2:A6 - This is the range over which the condition applies
"=Shirts" - the conditional expression.
B2:B6 - The cells under consideration for summing up.

how do I average three columns where the criteria changes each month..ie last three monthly data

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

Fill dates array and add dummy variables

I have a column with dates called "dates". This column contain dates from 01.01.2010 to 31.12.2010. it should have about 365 rows, but it actually has only 231 rows, because the data was not collected regularly. The others are missing, and I'd like to fill the gaps in time.
How can I fill the array of this column with the missing dates? I want to add 134 rows in the place of the missing ones, filling in the missing dates.
Create another sheet and put all the dates in column A in your new sheet.
Make sure your sheet with the data in it has the data column all the way on the left (important for how Vlookup works)
In your new sheet, starting in Cell B2 put numbers 1 through however many columns you have in your data sheet along that top row.
In your new sheet use Vlookup to find all the rows where there are data
=VLOOKUP($A2,DataSheet!$A$1:$C$20,B1,FALSE)
Note that the lookup column ($A1) is locked in to the column but not the row and that the range you are looking up is locked in in all directions. This will allow you to drag to the right/down and fill everything in.
Drag to the right then drag all the way down.
there will be #N/As where you cannot find a match which you can suppress with either an IF statement of conditional formatting. But now you have a row for every day with blanks when there is not data!
I found a solution with a similar formula, but the result was the same.
First, I got the two columns of data—"date" and "values" in the columns A and B of the worksheet. Each consisted of 231 rows. Then, I spread a full array of dates—365 in a new column D. Finally, I used this formula:
=VLOOKUP(D2;$A$2:$B$1056;2;FALSE)
in C2 and obtained the only the values from column "values" corresponded to the new dates of column D.
Thanks for Brad's answer for directing me to the VLOOKUP function.

Resources