Can someone please help me convert and understand the below formula in R1C1, I am struggling a bit with this. Thank you.
Here is my attempt:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Can someone please help me convert and understand the below formula in R1C1, I am struggling a bit with this. Thank you.
Here is my attempt:![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Last edited by cmccabe; 06-27-2014 at 04:19 PM.
R1C1 notation doesn't use $
R refers to the row containing the formula (a relative reference)
Ry refers to row y (an absolute reference)
R[+-y] refers to y rows above/below the cell containing the formula (a relative reference)
References to columns are symmetric.
Last edited by shg; 06-27-2014 at 04:28 PM.
Entia non sunt multiplicanda sine necessitate
So if I follow, A1 would be:
R[1]C[1] - R[1]C[2] = A1 - B1
R1C1 = A1
R[2]C[1], R[-1]C[-1] = moving from A2 to A1
R[2]C[3], R[-1]C[-3] = moving from C2 to A1
Thanks.
Last edited by cmccabe; 06-27-2014 at 04:46 PM.
R1C1 refers to A1, always and forever, regardless of where it appears, yes. All the others depend on where the formula is entered; they are relative references.
Assume you are in C5, that cell is = R5C3. It will always reference that cell its like a $C$5
If you are in C5 and put in an equation =R[1]C[1] . It will give you the value of D6 (One row positive/down and One column positive/right)
If you are in C5 and put in an equation =R[-1]C[-1] . It will give you the value of B4 (One row negative/up and One column negative/left)
If you are in C5 and put in an equation = R3C2. It will give you the value in B3 (Row3 column2)
(Row,Column)
A1 = 1,1
B2 = 2,2
C10 = 10,3
Last edited by briguin; 06-27-2014 at 05:27 PM.
Panel!$B$2:$B$6713
Should be
Panel!R2C2:R6713C2
Row2 = Row2
Col2 = B
Col3 = C
Col4 = D
Last edited by briguin; 06-27-2014 at 05:27 PM.
Why do you want to convert the formula to R1C1?
If posting code please use code tags, see here.
If it will help, I would point out that the relative reference R[1]C[1] can never refer to A1. A1 (R1C1) is the leftmost, topmost cell in a sheet. There cannot be a cell 1 row above and 1 column to the left of A1 (R1C1). It is not possible to have a relative R1C1 reference with positive offsets (positive numbers inside the []'s) that refers to A1.R[1]C[1] - R[1]C[2] = A1 - B1
If that made sense to you, then you are well on your way to understanding R1C1 references. If that created more confusion, then you still have a ways to go in understanding how these work.
Another thing I would point out is that R1C1 references, when copied, do not "change" -- the formula text looks exactly the same as it did in the original cell.R[2]C[1], R[-1]C[-1] = moving from A2 to A1
R[2]C[3], R[-1]C[-3] = moving from C2 to A1
Originally Posted by shg
Thank you that is very helpful.
Umm -- yes it can, if it's in the bottom right corner of the sheet.If it will help, I would point out that the relative reference R[1]C[1] can never refer to A1.
Norie,
theis pulling the wrong values.![]()
Please Login or Register to view this content.
It was brought to my attention that R1C1 was needed for VBA.
In this post, I explain how I know and have the formula that did work, and and attached workbook.
http://www.excelforum.com/excel-prog...-new-post.html Thank you.
That's wrong, R1C1 is not needed for VBA.
The formula may not be working but converting it to R1C1 isn't going to make any difference.
PS Did you every try changing $R$5, $Q$5 etc do $R5, $Q5 etc as I suggested - think I even posted code with those references changed.
Having never had a spreadsheet large enough to even consider this possibility, I always thought it was impossible. I did not realize these references could "wrap around". With Winnie the Pooh, I declare myself "foolish and deluded, and a bear of no brain at all."
I would modify my conclusion to, if you can understand how the wrap around works, you are well on your way to understanding how R1C1 relative references work.
Hmm, I have no idea whats wrong with the formula.
Have you tried stepping through it?
You can do that by selecting a cell with the formula in it, preferably one that's not giving the correct result, and going to the Formulas tab and clicking Evaluate Formula.
Yes and no. If your code says Range(...).FormulaR1C1 = then, yes! it will require a formula in R1C1 format. If, however, it says .Formula = then, no, it can be a formula as you would type it in the cell. In both cases, give or take. If you have any constants in quotes, you will need to double up the quotes.It was brought to my attention that R1C1 was needed for VBA.
In the original post, I think you should forget about the Const and just have:
![]()
Please Login or Register to view this content.
Note that VLOOKUP with fourth parameter of 0 or FALSE is required for an EXACT match.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Formula that worked when the values were all on 1 sheet
I can step through all the way to the evaluation of this (6C) (which is correct)![]()
Please Login or Register to view this content.
the code in the VBA:
I attached an imaage of the evaluate.![]()
Please Login or Register to view this content.
Thanks.
The formula that works is completely different from the formula in the code.
I don't understand. They are two completely different formulae. Nothing to do with whether or not it's on the same sheet. You've changed COUNTIFS to SUMPRODUCT and you have even changed the cells you compare.
No surprise it doesn't give the same result.
Regards, TMS
Below is the entire Code, if I change the SUMPRODUCT to COUNTIFS then the underlined line of code throws an erorr- application or object-defined. Thanks.
![]()
Please Login or Register to view this content.
You can't just change from COUNTIFS to SUMPRODUCT. The structure of the functions are different.
SUMPRODUCT and COUNTIFS are not interchangeable.
You might be able to substitute one for the other, but not without making significant changes.
How exactly are you changing the formula?
I just tried changing the sumproduct to countifs, as I do not know much about vba and formulas, what do you suggest. Thanks![]()
I'd suggest you look up the Help for both formulae and compare the structures. Also, check the parameters for VLOOKUP while you're at it.
Thank you.
You're welcome.
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
New quick method:
Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.
Or you can use this way:
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks