I use this formula to align cells like here
I put this formula in E3 and then I press CTRL+SHIFT+ENTER
=INDEX($D$3:$D$6,MATCH("*" & MID(B3,SEARCH("http",B3),99),$D$3:$D$6,0))
The formula stops at the first step, but does not consider that the function that values do not align correctly, that is what I seek.
if I change position of cells of column D formula return me this error:
#VALUE!
Look this pic, please:
Is there any solution to correct position of cells of column E with column D after first formula alignment between B-D?
Note: alignment must following same LINK and It should value the same function as a loop. Loop because function must look at the alignment with the neighboring column, in our case is the D until e.g http://beta.com link is on the same row level. They could take more steps, but eventually you have to get to an array. P.S: each link of start column (B) is unique
Simply put in E3:
=IF(D3<>"",INDEX(D:D,MATCH("*"&MID(INDEX($B$3:$B$6,COUNTIF($D$3:$D3,"<>")),SEARCH("http://",INDEX($B$3:$B$6,COUNTIF($D$3:$D3,"<>"))),999),D:D,0)),"")
and copy down. this is NOT an array formula.
EDIT
If I got you right, then all you want is to flip over the original formula...
=IF(D3="","",INDEX(B:B,MATCH("*" & MID(D3,SEARCH("http://",D3),999),B:B,0)))
Related
I need help with the following formula:
=INDEX(Sheet2!A2:A11,MATCH(Sheet1!Q5,Sheet2!C2:C11,0)+0)
(this part needs to change column references: Sheet2!C2:C11,0)+0)
I need to change the column reference whenever I'm dragging it down. I tried this:
=INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!Q4,OFFSET(Sheet2!$A$2:$A$12,0,ROW(O$4:O4)-1),0)+0)
but it always comes up with #N/A
I tried solution from other topics but couldn't find one that uses index and match.
PS. My formula starts from cell O5
Can you advise please?
Much obliged
In general, if you want to change the column reference when dragging down, use a combination of INDEX and ROW, e.g.
= INDEX($1:$1,ROW())
This will grab values further to the right in the first row as the formula is dragged down.
You can also modify this to have INDEX return a range (instead of just a single cell) to be used as part of another formula, e.g.
= INDEX($1:$5,0,ROW())
This returns a 5x1 array which shifts over to the right as the formula is dragged down. (The 0 in the above formula indicates to select all of the rows in the $1:$5 range.)
In your formula, you can try replacing this:
Sheet2!C2:C11
With this:
INDEX(Sheet2!$2:$11,0,ROW()+<offset>)
Where <offset> is the necessary offset that you need.
If your formula starts in O5 and you want that first formula to grab the C column, I imagine that <offset> should be -2. This is because ROW() of O5 is 5, but you want that cell to grab the 3rd column (so you need to subtract 2). Then when you drag down to O6, that part of the formula would evaluate to Sheet2!D2:D11, and in cell O7, it would evaluate to Sheet2!E2:E11, etc.
So your final formula should be:
= INDEX(Sheet2!A2:A11,MATCH(Sheet1!Q3,INDEX(Sheet2!$2:$11,0,ROW()-2),0)+0)
Further to my previous question, Im trying to get cell E20 (Total) to work similarly - sum all cells preceeding until the the formula itself (E20), again to avoid any cells being excluded as rows are added. So far i have:
=SUM(INDEX(E:E,ROW()+1):INDEX($E:$E,ROW() + IFERROR(MATCH(“TOTAL",INDEX(D:D,ROW()+1):$D1004001,0)-1,MATCH(“TOTAL”,INDEX(D:D,ROW()+1):$D1004001,0)-1)))
So far I am simply returning an error message.
I am trying to sum everything in column E until it reaches one cell above the word Total in column D, to avoid a circular reference. Any thoughts?
Screenshot of workbook
No volatile or array formulas needed:
In E2:
=IF(F2="",SUM(INDEX(F:F,ROW()+1):INDEX(F:F,MATCH(1E+99,F:F)))-SUM(INDEX(E:E,ROW()+1):INDEX(E:E,MATCH(1E+99,F:F))),"")
And copy down the Column. Then a simple sum formula at the bottom
E2:
=AGGREGATE(9,6,(OFFSET(F3,0,0,
AGGREGATE(15,6,ROW(F3:F999)/ISBLANK(F3:F999),1)-ROW(F3))))
Copy/Paste into E8 and E14. The formula for the Total is pretty simple:
E20:
=SUM(E$2:E19)
After entered as indicated, these formulas will auto-adjust when you insert or delete rows in between, because they use relative references.
There's probably better ways, but this will work. I In cell E2, =SUMIF(F1:F7,"<>""""",F1:F7) and similarly in cell E8, etc. The range intentionally includes blank lines above and below each block of data, to ensure that Excel will adjust for any lines that you insert or delete.
For E20 you can just use the same format, =SUMIF(E1:E19,"<>""""",E1:E19)
i am making an application for which i have to read the formulas from excel. After many search i was able to read the formula behind a field. But i was not able to understand it. Can somebody help me in this regard?
Formula is
ActiveCell.Offset(0, 5).FormulaR1C1 = "=RC18-3*(AVERAGE(C19)/1.128)"
Actually i am not uderstanding what is RC18 and C19 at clicking the specific fields it gives this formula.
=$R27-3*(AVERAGE($S:$S)/1.128)
how RC18 = $R27
That's Relative Cell Reference. R/C do not mean a cell address.
RC18 means "The cell in the same row, column 18"
In relative reference R means "row" and without a number next to it, means the same row as the cell wherein the formula resides. (an R without a C would mean the entire row, e.g., R1 would be Row 1.)
C18 means column 18. Similarly, without the C19 means Column 19, or, column S.
Using square brackets for the number indicates an offset, where negative would be a left offset (columns) or an up offset (rows), and otherwise offsets are right (columns) and down (rows), so:
R[1]C[1]
Would be the cell one row below and one column to the right of the active cell, and likewise:
R[2]C[-3]
Would be the cell two rows below and three columns left of active cell.
That's because the formula is built by using R1C1 notation as explained here and here(external)
Having RC18 would mean that it refers to the 18th column from the cell you are and, when you check on a given cell in that column, the formula is "translated" to cell in 27th row for that range (the column 18). If any, please show a screen capture to keep on checking.
Simple one for someone hopefully. I'm trying to get the max length of each column in an excel sheet but it doesn't seem to be working now. I was using =MAX(LEN(A2:A200)) for example and because MAX is not an "official" formula but is still there you seem to have to press CTRL + ALT + SHIFT once you have finished typing it.
When I do this it puts curly brackets round the whole formula like this {=MAX(LEN(A2:A200))} but if I click into the cell they disappear. the length of the first column will appear but then if I autofill to the next column it shows same length of column data from the first column rather than calculating the next column.
Perhaps not a straight up programming question but scratching my head why this is not working now. I'm trying to show max length of each column above header column in new row.
Thanks
Andrew
In A1 enter the array formula:
=MAX(LEN(A2:A200))
then stop clicking.
Move to A1 with the ARROW keys. Touch Ctrl+c. Then paste to B2 through G2 using Ctrl+v:
This will put the array formula in the destination cells.
Use Gary's formula and instead of ENTER, do CTRL-SHIFT-ENTER
When I do this it puts curly brackets round the whole formula like this {=MAX(LEN(A2:A200))} but if I click into the cell they disappear. the length of the first column will appear but then if I autofill to the next column it shows same length of column data from the first column rather than calculating the next column.
It is right to use formulas with brackets (they are called Matrix formulas). The brackets disappears because when you edit the content of the cell you have to push Ctrl + Shift + Enter and not only Enter like normal formulas.
Let's assume all your data is in Sheet1 starting at cell A1.
Create Sheet2
Enter the =LEN(Sheet1!A1) formula in cell A1 on Sheet2
Pull Sheet2's A1 cell down/over to the right to cover the populated
range of Sheet1 (to copy the formula to every cell of the range in
scope) - this will give you the length of every cell in scope
Enter the =MAX(A1:A10) formula on Sheet2 in the first column below
the last line (A10 is assumed to be the last line of the first
column in this example - so the formula goes in A11)
Pull Sheet2's A11 cell over to the right till the last column to get
the MAX length of values for each column
I have an Excel sheet in which I want start column D with the following formula:
=AVERAGE(C7:C10)
I want to be able to drag down column D to give the following formulae:
=AVERAGE(C11:C14)
=AVERAGE(C15:C18)
=AVERAGE(C19:C22)
etc.
However, if I just naively drag down, instead, I get:
=AVERAGE(C8:C11)
=AVERAGE(C9:C12)
=AVERAGE(C10:C13)
How can I change this behavior?
In column D enter
=AVERAGE(OFFSET($C$1,4*ROW(C1)+2,0,4))
Then when you drag it down column D, each successive cell will have the reference incremented by 4.
This answer assumes that the size of the ranges remain constant. If, for example, column G is unpopulated then G1=7;G2=11. Select both cells and pull the fill handle down as far as needed. The formula for D1 is=AVERAGE(INDIRECT("C"&G1&":C"&G1+3)), which can be filled down as far as needed.