+ Reply to Thread
Results 1 to 7 of 7

Why Formula R1C1 put bracket automatically?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-26-2013
    Location
    Makati
    MS-Off Ver
    Excel 2010
    Posts
    138

    Why Formula R1C1 put bracket automatically?

    Hi guys,

    This is probably a stupid question but i'm currently struggling with this right now. Below is my line of code to put formula into Cell D4

    Me.Sheets("ETF Holdings").Cells(4, 4).FormulaR1C1 = "=IFERROR(INDEX('FV Database'!B:B,MATCH('ETF Holdings'!RC[-2],'FV Database'!A:A,0)),INDEX('FV Database'!B:B,MATCH(SUBSTITUTE('ETF Holdings'!RC[-2],""."",""-""),'FV Database'!A:A,0)))"
    why it turn to be this when it being put in the cell?

    =IFERROR(INDEX('FV Database'!B:(B),MATCH('ETF Holdings'!B4,'FV Database'!A:(A),0)),INDEX('FV Database'!B:(B),MATCH(SUBSTITUTE('ETF Holdings'!B4,".","-"),'FV Database'!A:(A),0)))
    The problem is on the FV Database'!B:(B) part, why it's turn out to have a bracket??

    I seldom use R1C1 style so kindly help to enlighten me, thanks in advance !!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Why Formula R1C1 put bracket automatically?

    It's because you are mixing A1 and R1C1 notation in the formula.

    Try changing FormulaR1C1 to Formula and changing RC[-2] to B4.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-26-2013
    Location
    Makati
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Why Formula R1C1 put bracket automatically?

    Hi Norie,

    Thanks for the reply. Sorry if i didnt make it clear, the reason i need to use R1C1 style is because i will loop the formula later on, so in my code whereever i put the formula, the reference will always be RC[-2], which is 2 column on the left of the formula.

    But for the Array column reference
    ( FV Database'!B:(B) )
    i don't want it to change when i move it to another cell, Hope this makes it clear.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Why Formula R1C1 put bracket automatically?

    Change A:A to C1 and B:B to C2.

    By the way, how are you going to loop the formula?

  5. #5
    Forum Contributor
    Join Date
    06-26-2013
    Location
    Makati
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Why Formula R1C1 put bracket automatically?

    I tried that also C1 turn out to be E:E, and C2 turn out to be F:F when the formula is in the cell

    This is actually a long code,to avoid confusion i didn't put it in..

    This part of my code
    Me.Sheets("ETF Holdings").Cells(4, 4).FormulaR1C1
    is actually..
    Me.Sheets("ETF Holdings").Cells(Lr, Sc).FormulaR1C1
    So it will put the formula in a different cells on the loop

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Why Formula R1C1 put bracket automatically?

    Strange because whenever I try this C1 comes out as $A:$A and C2 comes out as $B:$B no matter what Cells(4,4) is changed to.
        Me.Sheets("ETF Holdings").Cells(4, 4).FormulaR1C1 = "=IFERROR(INDEX('FV Database'!C2,MATCH('ETF Holdings'!RC[-2],'FV Database'!C1,0)),INDEX('FV Database'!C2,MATCH(SUBSTITUTE('ETF Holdings'!RC[-2],""."",""-""),'FV Database'!C1,0)))"
    Can you post what you actually tried?

  7. #7
    Forum Contributor
    Join Date
    06-26-2013
    Location
    Makati
    MS-Off Ver
    Excel 2010
    Posts
    138

    Re: Why Formula R1C1 put bracket automatically?

    OMG....now it works..wow..i really don't know what happen, i tried that before but it doesn't work and now it works...

    Whew..i think that shows how stressed and tired i am now, thanks Norie for your time ^^

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-18-2014, 03:00 AM
  2. [SOLVED] Formula to remove certain character in a bracket
    By dare2join in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-17-2014, 05:01 AM
  3. Age Bracket using Lookup formula?
    By cathal1292 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-03-2013, 06:55 PM
  4. Excel 2007 : Formula for extraction of text in bracket
    By bernard.x in forum Excel General
    Replies: 4
    Last Post: 12-08-2010, 02:20 AM
  5. Remove String Within the Bracket and also the Bracket
    By seanyeap in forum Excel General
    Replies: 6
    Last Post: 04-23-2010, 10:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1