Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reading RC convention

Posted on 2011-02-14
5
Medium Priority
?
415 Views
Last Modified: 2012-05-11
Hi,

Im going through other peoples code and in the editor im trying to work out what the macro is doing

One example is

=ISERROR(IF(RC[-1]="","New Item",IF(RC[-1]=RC[-42],"No","Yes")))

How do i read that RC-1 AND RC -42?

Does it mean rows/columns, what is the above doing in terms of letters?
0
Comment
Question by:Seamus2626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 6

Assisted Solution

by:FernandoFernandes
FernandoFernandes earned 800 total points
ID: 34890072
the RC referencing style is very interesting way to deal with relative referencing.
R1C1 is cell A1
R5C10 is cell J5
but when you start using the square brackets, you are referencing relatively, and it will always depend on where you're putting the formula, each cell will have a different behavior.
Example:
R[1]C = means same column, one row down
R[-1]C = means same column, one row above
RC[5] = means same row, 5 columns to the right
RC[-1] = means same row, 1 column to the left
RC[-42] = means same row, 42 columns to the right. This means that if you put this formula anywhere before column AP, you'll get a #REF errors...

is it clearer now ? :)
0
 
LVL 4

Assisted Solution

by:abitoun
abitoun earned 400 total points
ID: 34890077
RC is exactly the current row column position so the same row column to the left (current position minus one) is null then the current position will read new item, if the row column to thel eft es equal to the row columnt 42 places to the left then the current position will read No otherwise Yes.
0
 
LVL 33

Accepted Solution

by:
jppinto earned 800 total points
ID: 34890098
Please read this article to understand about R1C1 references:

http://excel.tips.net/Pages/T003010_Understanding_R1C1_References.html

Also this code from byuntd will convert references from R1C1 to A1 and vice-versa:

http://www.vbaexpress.com/kb/getarticle.php?kb_id=254

jppinto
0
 
LVL 6

Expert Comment

by:FernandoFernandes
ID: 34890121
BTW, if your Excel is showing you the formulas like that, you'd better change the Referencing Style to the standard one (rows with numbers and columns with letters).

On Excel 2003:
Tools / Options / General / R1C1 reference style (must be unchecked)

On Excel 2007 and 2010:
Office button /  Excel Options / Formulas / Working with formulas / R1C1 reference style (must be unchecked)
0
 

Author Closing Comment

by:Seamus2626
ID: 34890139
Thanks guys!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question