All I need it to do is update Columns O10, Q10, S10, U10, W10, Y10,AA10 with the amount of hours for the relevant day from the 'Hours' sheet and then Columns P10, R10, T10, V10, X10, Z10 to pull from the 'Hours' sheet (but this one will need to cross reference the absence codes in AF11-AG19.
I hope I have explained this well enough, if there is a formula/look up that can do this the result would be the same as what I have typed in manually for Tom Smith.
Thanks in advance ,
Tom
These are very basic Excel concepts. Cells are identified by cell references. So on the default worksheet, let's say it's Sheet1, the upper left hand cell is A1.
To reference from a different location on a different sheet, you need to use extended addresses. Let me use a very simple example. The extended address format is essentially the sheet name, an exclamation point, and then the basic cell reference.
Let's say you have the value 7.5 in cell A1 in the worksheet "Hours". That's the first column and first cell in that column.
Also the value 4.5 is in cell A2 in the worksheet "Hours". That's the second cell in the first column; and it's also in the second row.
Let's say you want a summary sheet. The worksheet is named "Sum". You want to sum from the hours sheet.
In A1 on Sum sheet, type:
=Hours!A1
In A2 on Sum sheet, type:
=Hours!A2
In A3 on Sum sheet, type:
=SUM(A1:A2)
A brief explanation: https://smallbusiness.chron.com/cross-reference-between-excel-spreadsheets-41572.html
Related
Need Help on Named Ranges in Formulas:
I have a second workbook ('TEST.xlsx') as the destination, referencing worksheet-scoped named ranges (in 12 columns X 75 rows) in the source workbook ('FLOW.xlsx'). I want to create a formula that will match a look-up value (a date entered into cell C3 in TEST that will return the matching named range IF there are 2 or more blank cells in that matched named range/column and the remaining named ranges/columns in that set of 12 columns with 2+ blank cells. The 12 separate columns in the source workbook ('FLOW') are named by month, year and location (ex., "jan_2019_class.1","feb_2019_class.1", etc.), the worksheet columns being C, H, M, R, W, AB, AG, AL, AQ, AV, BA, and BF. The rows are 80-155. I've only been able to make a simple working COUNTBLANK formula in my TEST workbook, ex.:
=COUNTBLANK('[FLOW.xlsx]Class_1-Chart'!jan_2019_class.1)
But NOT for successive columns (with different named ranges and the columns are non-sequential); and I can't figure out the functioning formula to combine with this to get the count AND data returned by criteria as described above. Please, no VBA/macros.
Thank you in advance for the help!
'TEST.xlsx' Screen Shot-RVSD
FLOW.xlsx- sample screenshot
There are many approaches but I personally prefer the use of helper rows/columns/cells and named ranges.
In my demonstration I used two class attendant schedule in two different year from January to June as shown below (they are sitting in Column C to M in my example):
As shown above, I have added two helper rows on top of each schedule. The first helper row is used to find out if there is 2 or more vacancies in each month, if so returns TRUE. I have given the name check.2019.class.1 and check.2021.class.5 for each of them.
The second helper row is simply showing the range name of each month such as jan_2019_class.1, feb_2019_class.2 etc. I have given the name NameRng.2019.class.1 and NameRng.2021.class.5 for each of them.
On the TEST sheet I have the following set up:
where the look up value in cell C3 is actually returned by a formula so it can be "dynamically" changed by the user. Please note in the following formula I used a name ClassNo which is essentially the value from cell B3.
=B2&"_"&B1&"_class."&ClassNo
I have also named cell C3 as Start_MthYrClass which will be used in my following formula.
The formula for looking up the first available month in 2019 if the start month is jan_2019_class.1 is:
=INDEX(NameRng.2019.class.1,MATCH(1,(TRANSPOSE(ROW($1:$11))>=MATCH(Start_MthYrClass,NameRng.2019.class.1,0))*Check.2019.class.1,0))
Please note it is an array formula so you MUST press Ctrl+Shift+Enter upon finishing the formula in the formula bar otherwise they will not function correctly.
The logic is to first "filter" the range NameRng.2019.class.1 using this formula =TRANSPOSE(ROW($1:$11))>=MATCH(Start_MthYrClass,NameRng.2019.class.1,0), in which ROW($1:$11) represents {1;2;3;4;5;6;7;8;9;10;11} and TRANSPOSE will turn it into {1,2,3,4,5,6,7,8,9,10,11}. This range of numbers represents the column index in that specific range which is Column C to M (in your case it would be ROW($1:$56) as your data is in Column C to BF). Then I use MATCH to return the start column index of the look up month jan_2019_class.1, and it should return 1 as this month starts in the 1st place/column in the range NameRng.2019.class.1. So this is what I am actually comparing: {1,2,3,4,5,6,7,8,9,10,11}>=1, and it will return {TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE}.
Then I multiply the above result with range Check.2019.class.1 which is essentially {FALSE,0,FALSE,0,TRUE,0,FALSE,0,TRUE,0,TRUE}. Then I will get {0,0,0,0,1,0,0,0,1,0,1}. FYI in Excel TRUE=1 and FALSE=0, so TRUE x FALSE = 0 while TRUE x TRUE = 1.
Lastly, I use MATCH to find out the position of the first 1 in the above result which is the 5th place/column, and then use INDEX to return the corresponding value from range NameRng.2019.class.1 which is mar_2019_class.1.
Here is a more universal formula which allows you enter it in the first cell C6 and drag it down to apply across board, if you have given names to the relevant cells and ranges in the same way as what I have demonstrated.
=IFERROR(INDEX(INDIRECT("NameRng."&B6&".class."&ClassNo),MATCH(1,(TRANSPOSE(ROW($1:$11))>=MATCH(Start_MthYrClass,INDIRECT("NameRng."&B6&".class."&ClassNo),0))*INDIRECT("Check."&B6&".class."&ClassNo),0)),"")
It is also an array formula so you MUST press Ctrl+Shift+Enter upon finishing the formula in the formula bar.
It is essentially the same formula as the first one but I have added IFERROR to return a blank cell if there is no match, and I used INDIRECT to refer to the named ranges dynamically based on the year and class number chosen.
Now, if I change the look up criteria to mar_2021_class.5, here is an updated result:
Let me know if you have any questions. Cheers :)
=Indirect("'App Summary'!"&$D$4&"18")
I have two worksheets, Sheet 1 and App Summary. On Sheet 1 in cell D4 I have a column lookup based on a value typed in cell B2. So for instance, if I type in July in cell B2 of Sheet 1, it will place H in cell D4 of Sheet 1. If I type in June in cell B2 of Sheet 1, then it will place G in cell D4 of Sheet 1. Using the above indirect formula, I look up a value in App Summary using the column reference in cell D4 on Sheet 1.
My question is the following. Is there a way to make the above formula dynamic so that if I add a row to the App Summary sheet it will automatically adjust the row in the formula? For instance in the above example lets say I am referencing H18 in the app summary sheet. If I add a row in the app summary sheet just before H18, how do I get the formula on sheet 1 =Indirect("'App Summary'!"&$D$4&"18") to update to =Indirect("'App Summary'!"&$D$4&"19") since the row it was referencing shifted down one?
Assuming from I am referencing H6 in another sheet , the other sheet is App Summary use
=INDIRECT("'App Summary'!"&D3&ROW('App Summary'!$A$6))
If you can be certain that any additional rows in App Summary will be added as right-click and Insert row, then you could reference the a cell in the last row with an absolute reference (using dollar signs to fix the reference).
Another approach would be to convert your App Summary to an Excel table (ctrl + t) and then use structured referencing. That way, you are not vulnerable to the changing structure of the App Summary sheet (except if you change column headings).
I'm sure this is simple, but I can't figure it out and am not very familiar with macros...
I have a workbook that has 5 sheets.
Sheet 1 - Has all employee name (2 cells - first and last name) with a lot of info
Sheet 2 to 4 - Has the employees divided up across these three sheets.
What I want to do:
If the employee first,last name on Sheet 1 matches the first,last name on sheet 2,3 or 4 then copy cells f,g,h,i,j,k,l from that row in sheet 1 to corresponding sheet 2-4 where name is found.
I hope that makes sense.... Basically, transfer/copy employee row from main sheet to sheet 2, 3, or 4.
If sheet1 a2 and b2=sheet2 b15 and c15 then copy sheet 1 f2,g2,h2,i2,j2,k2,l2 to sheet2's n15,o15,p15,q15,r15,s15,t15.
I've tried: =INDEX(RN!All_Original!F,MATCH(C3:D3,All_Original!C:D,0))
Thanks!!
I think you're getting there with the Index/Match you showed. I don't know how your data is laid out, but I think you're just a few small keys.
I have "Sheet1", which is this:
And in "Sheet2", we have:
So, we want to fill in, automatically, the "Fun Fact" for whoeever the person is, in this case Kobe Bryant. You can use this formula:
=INDEX(Sheet1!$C$2:$D$5,MATCH($A2&$B2,Sheet1!$A$2:$A$5&Sheet1!$B$2:$B$5,0),MATCH(C$1,Sheet1!$C$1:$D$1,0))
(Enter as an array, with CTRL+SHIFT+ENTER)
If you change "Fun Fact" to "Favorite Food", it will update with "Italian". You can use this formula on your other sheets. Obviously, you will need to adjust the range(s) as necessary.
Edit: Note that the range sizes in the formula must be the same size, for it to work properly. My last row is always 5. So, always use that range.
I want to reference the worksheet name and then transpose the totals in row 1 to a column in my summary worksheet.
I have found the following formula, which looks up a worksheet and takes the total, then I can paste this down to look up the row, essentially transposing row H1 to AG1 to column B on my summary worksheet.
=INDEX('201510'!$H$1:$AG$1,ROWS(B$1:B1))
Now I want to replace the direct ref to the worksheet tab to a lookup. So when I type the worksheet name in say row 2, it will give me the monthly totals.
This formula looks up the tab reference in B2 and displays the contents of H1. Where B2 has the worksheet name.
=INDIRECT("'"&$B$2&"'!$H1")
However when I copy this formula down the column, H1 does not change to H2. Furthermore, I need it to transpose vertically to I1.
How can I combine the two formulae?
Thanks,
Andy
You will need to combine the logic of an INDIRECT function with regular Excel referencing. Note that in your final formula, the "'!$H1" is text, meaning Excel doesn't try to compute it until it calculates the value of the cell. ie: it does not compute that what you are typing is a reference, just text.
So, assuming you continue to use the INDIRECT function, you will need to create the address of the final portion dynamically. There are many ways to do this. For example:
=INDIRECT("'"&$B$2&"'!H"&ROW()-1)
This version takes the string of the sheet name from B2, and then adds on the "'!H" as an additional string, and then takes the row as the current row number of the cell above the cell the formula is in. ie: if this formula is in D2, it will look up H1 on the other sheet. This method relies on your formula being in a consistent position within your sheet - if you insert a row above this one, it will change what ROW() calculates as, thus changing the formula.
Another method would be to reference H1 in a way that consistently points there, and also iterates into higher numbers as you drag down the formula. This method may be more useful for your purposes, as it also teaches another function:
=INDIRECT(ADDRESS(ROW(H1),COLUMN(H1),,1,$B$2))
Note that the ADDRESS function creates a string which shows the way a direct reference to a specific cell would. with the arguments I have above, it picks up the row number of H1 [iterating down, as there are no $ in front of the 1], the column number of H1 [iterating to the right, as there is no $ in front of the H], and the sheet name from $B$2.
So at the top of my Excel sheet I have 2 cells, A2 and B2, where people can enter a starting and ending date.
On a seperate sheet I have an enormous list of starting and ending dates in columns A and B, and corresponding data for each of these 'events' in columns D through G. I need my function to copy all rows where the starting date falls between the two specified dates, and copy the data to the first sheet, in cells A4 - G4 through A100 - G100. (I just chose 100 as a large number, to make sure the area where the data gets placed is large enough)
I'm guessing this function I need includes the INDEX function, but I only know how to use it to look up one data cell at a time, not how to copy an entire range of cells.
Can anyone help?
No helper columns required.
Enter this formula into cell A4:
=IFERROR(INDEX(data!D$2:D$9999,SMALL(IF((data!$A$2:$A$9999>=$A$2)*(data!$A$2:$A$9999<=$B$2),ROW(data!$D$2:$D$9999),9E+99),ROW(1:1))-1),"")
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Now copy the formula to the range B4:D4.
Now copy the A4:D4 to the range A5:D100.
That's it.
Let's say Column C in the data sheet is blank, and free to add a formula.
Let's also assume that the data begins in row 2.
Then the following formula can be put in C2 & copied down:
=IF(AND(A2>=Sheet1!$A$2,B2<=Sheet1!$B$2),C1+1,C1)
Basically it is saying that if the beginning date of the current record is greater than or equal to the date the user is looking for, and the ending date is likewise within range, iterate the record, otherwise not.
At this point the user sheet can have a simple VlookUp as follows:
In D1: =VLOOKUP(ROW($A1),Sheet2!$C:$G,COLUMN(B$1),0)
Copy this across to G and down however many rows you like.