This question already has an answer here:
Monitor cell value and copy it to another cell
(1 answer)
Closed 8 years ago.
I am trying to create a spreadsheet, where on one sheet I have data (to which I will add a new row with new figures each week) and on another sheet, a summary of the most recent 4 weeks using =SHEET1!B4:C4 as a formula (for example).
How can I lock that formula so that (in Sheet 1) when I add a new row for a new week, the formula doesnt adjust to =SHEET1!B5:C5?
To lock a formula against a row, column, or cell, use the $ before the row/column. =SHEET1!$B$4:$C$4 will lock both row and column, if you just need to lock the rows, then use =SHEET1!B$4:C$4.
Alternatively, you can name the range (in your case a single cell), see here: http://spreadsheets.about.com/od/exceltips/qt/named_range.htm
Edit:
Following your comment I think I understand. You will need the OFFSET function anchored to the latest datum.
See the is walk through: http://excelsemipro.com/2010/10/the-offset-function-last-7-data-points/
and this tutorial shows more info
To Lock data:
=SHEET1!B4:C4
should be replaced with
=SHEET1!$B$4:$C$4
Here's some further notes: http://blogs.msdn.com/b/rextang/archive/2007/06/07/3136694.aspx
Related
This question already has answers here:
Vlookup using 2 columns to reference another
(2 answers)
Closed 1 year ago.
I want to write kind of formula (look-up) where i can match and bring data from another sheet using combination of 2 columns without concatenation. I am doing using following formula at the moment:
+VLOOKUP(A1&B1,'other_sheet'!A:D,4,0)
where Colomn A in other sheet in concat of B1 and C1 (B1&C1)
However, my intention is to to get same result without doing any concat as you can see in below pic:
You could try:
For microsoft365:
=FILTER(G$2:G$9,(E$2:E$9=A2)*(F$2:F$9=B2),"")
Drag down. Or if you don't want to drag down the formula and BYROW() is available:
=BYROW(A2:B6,LAMBDA(a,FILTER(G2:G9,MMULT(--(E2:F9=a),{1,1})=2)))
For older versions of Excel try:
=INDEX(G$2:G$9,MATCH(1,INDEX((E$2:E$9=A2)*(F$2:F$9=B2),),0))
Or:
=LOOKUP(2,1/((E$2:E$9=A2)*(F$2:F$9=B2)),G$2:G$9)
Drag down.
In your example, you can do:
=INDEX('other_sheet'!D:D, MATCH(A1&B1,'other_sheet'!A:A&'other_sheet'!B:B,0))
where 'other_sheet'!A:A, 'other_sheet'!B:B, and 'other_sheet'!D:D might also be a range like 'other_sheet'!A1:A100, 'other_sheet'!B1:B100 and 'other_sheet'!D1:D100.
This question already has an answer here:
Drag a formula down with Row changes by another interval other than one
(1 answer)
Closed 5 years ago.
This is a weird incrementing problem, and I've tried switching to R1C1 cell referencing but Excel doesn't recognize formulas to refer to those cells so I'm back.
So say I've got cell C2800, and I need this to be =C1109. Next, I need cell C2801 to also =C1109. I then need this pattern to repeat as I drag. Something like this
=C1109
=C1109
=C1110
=C1110
=C1111
=C1111
...
I've tried the drag down straight but excel thinks this is a flat cell incrementer and simply adds 1 each movement. So essentially I need a formula for a cell refer to a position 1691 spots directly above, and then 1692 spots directly above, then 1691, then 1692, continue and repeat. Let me know if any of you know how to make this feasible
Use INDEX():
=INDEX(C:C,INT((ROW(1:1)-1)/2)+1109)
Where /2 is the repetition wanted and the +1109 is the starting row.
This question already has answers here:
Excel subset column to an array using formula
(2 answers)
Closed 5 years ago.
I have a worksheet that looks something like this
Derrick 123456 good credit
warren 325234 bad credit
john 645345 bad credit
martin 123142 bad credit
Jiren 647546 good credit
I am looking for a formula to search column 3 and if it returns bad credit it draws the values to the left of it on a new sheet for all the bad credits. Conditional formatting is it called?
Sorry for being vague, excel is not my cup of tea.
Edit:
Filtering Worked best as the array formula slowed down the workbook significantly, thanks to pnut, don't know why he deleted his responses.
In sheet2 use the following:
For first column in A2:
=IFERROR(INDEX(Sheet1!$A$2:$A$6,SMALL(IF(Sheet1!$C$2:$C$6="bad credit",ROW(Sheet1!$C$2:$C$6),99999),ROW(A1))-1),"")
For the second column in B2:
=IFERROR(INDEX(Sheet1!$B$2:$B$6,SMALL(IF(Sheet1!$C$2:$C$6="bad credit",ROW(Sheet1!$C$2:$C$6),99999),ROW(A1))-1),"")
Array formulas press Ctrl+Shift+Enter at the same time instead of Enter
change the references A2:A6, B2:B6, C2:C6 to correspond to the last row in your Data (starting in 2nd row)
Keep the $ for fixed references
You can drag each formula in its column
This question already has an answer here:
INDEX and SMALL only returning one result
(1 answer)
Closed 7 years ago.
I'm looking for what I thought would be a pretty straightforward formula to compile a list of names based on a criterion. For example, I would have a list of 50 employee names in column A and then a "Y" or "N" next to each name in column B. I would then like to have another tab on the spreadsheet list the names of everyone with a "Y" value in column B. I dont want empty rows between the names in the list on the new tab (this is why I haven't had success with IF statements). I also would like to avoid manually filtering out blank rows.
Lets say your first sheet is Sheet1
on Sheet 2 on a1 enter:
=IF(ISERROR(INDEX(Sheet1!A:A,MATCH("Y",Sheet1!B:B,0))),"",INDEX(Sheet1!A:A,MATCH("Y",Sheet1!B:B,0)))
On a2 enter:
=IF(ISERROR(INDEX(INDIRECT("Sheet1!A"&MATCH(A1,Sheet1!A:A,0)+1&":A50"),MATCH("Y",INDIRECT("Sheet1!B"&MATCH(A1,Sheet1!A:A,0)+1&":B50"),0))),"",(INDEX(INDIRECT("Sheet1!A"&MATCH(A1,Sheet1!A:A,0)+1&":A50"),MATCH("Y",INDIRECT("Sheet1!B"&MATCH(A1,Sheet1!A:A,0)+1&":B50"),0))))
And just drag the 2nd formula down.
Note that I assumed your first sheet is with 50 Rows as you wrote, Otherwise additional modifications needs to be made.
The formula you are looking for is quite complicated and requires cyclic calculation. For this reason, it is not advisable to use for long lists of several hundred or thousand 'names' but a list of 50 names should pose no discernible difficulties.
With the names in Sheet1's A2:A51, use this formula in the worksheet destined to receive the Y names.
=IFERROR(INDEX(Sheet1!$A$2:$A$51, AGGREGATE(15, 6, ROW($1:$50)/(Sheet1!$B$2:$B$51="Y"), ROW(1:1))), "")
Fill down as necessary. Note that the AGGREGATE¹ function is returning the position within A2:A51 with ROW(1:50).
Retrieving the non Y names should be a simple matter of changing the primary condition to (Sheet1!$B$2:$B$51="N") or (Sheet1!$B$2:$B$51<>"Y").
For pre XL2010 circumstances, this standard formula performs the same filtered retrieval.
=IFERROR(INDEX(Z!$A$2:$A$51, SMALL(INDEX(ROW($1:$50)+(Z!$B$2:$B$51<>"Y")*1E+99, , ), ROW(1:1))), "")
¹ The AGGREGATE function was introduced with Excel 2010. It is not available in earlier versions.
I got the following working formula:
={SUM(SUM.IF(
'Sheet1'!$B:$B;
IF(INDEX(List;;MATCH($D$4;Month;0);2);INDEX(List;;1);0);
'Sheet1'!$H:$H
))}
I would like to make it working if the ranges (Sheet1) are actually in a closed workbook. I found the following article:
http://support.microsoft.com/kb/260415
I don't know where to start to make it working assuming B:B and H:H are in another workbook.
D4 is the current month, Month is a list with the 12 months and List is composed of 2 zones, the first one with unique IDs that I need to compare with the B:B range and the second zone with 12 booleans columns telling me if I actually want to consider that ID for the desired month.
If I just convert it using the Microsoft KB, the following won't work (#N/A! error if entered as an array formula and I just get the total number of lines of the sheet if I enter it as a normal formula):
={SUM(IF(
'[myFile.xlsx]Sheet1'!$B:$B = IF(INDEX(List;;MATCH($D$4;Month;0);2);INDEX(List;;1);0);
'[myFile.xlsx]Sheet1'!$H:$H;
0
))}
After #barry houdini's answer, here are the exact formulas I have (still a little bit simplified). The second one (his answer) doesn't give me the exact same number because it does add up the numbers in the H columns where the B column is empty (even if List doesn't have any empty rows).
Working
=SUM(SUMIF(
'April'!$B:$B;
IF(INDEX(List;;4;2);INDEX(List;;1);0);
'April'!$H:$H
))
Almost working
=SUM(
IF(
ISNUMBER(
MATCH('April'!$B:$B;IF(INDEX(List;;4;2);INDEX(List;;1);0);0)
);
'April'!$H:$H
))
Your problem is that Excel doesn't know how to compare a whole column...
'[myFile.xlsx]Sheet1'!$B:$B
to a differently sized list, i.e. that returned by
IF(INDEX(List;;MATCH($D$4;Month;0);2);INDEX(List;;1);0)
Try using MATCH to do that, i.e.
revised as per comments:
=SUM(IF('[myFile.xlsx]Sheet1'!$B:$B<>"",IF(ISNUMBER(MATCH('[myFile.xlsx]Sheet1'!$B:$B;IF(INDEX(List;;MATCH($D$4;Month;0);2);INDEX(List;;1);0);0));'[myFile.xlsx]Sheet1'!$H:$H)))
or alternative.....(see comments) which avoids the extra IF
=SUM(IF(ISNUMBER(MATCH('[myFile.xlsx]Sheet1'!$B:$B;IF(INDEX(List;;MATCH($D$4;Month;0);2);INDEX(List;;1);"");0));'[myFile.xlsx]Sheet1'!$H:$H))
confirmed with CTRL+SHIFT+ENTER
MATCH returns a number (when there's a match) or #N/A so when you wrap that in ISNUMBER you get a list of TRUE/FALSE values as required.
Note: this will probably be slow using whole columns B and H (SUMIF will only use the "used range", this will use the whole column) so, if you can, I recommend using a more limited range
I'm guessing that list and months are named ranges in the closed workbook. This being the case you cannot reference named ranges in a closed workbook. Convert your use of List and Month to actual cell references in the closed workbook.