+ Reply to Thread
Results 1 to 15 of 15

ISBLANK() not working with "R1C1" reference

  1. #1
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    ISBLANK() not working with "R1C1" reference

    I tend to use ISBLANK(ref) in IF functions as i step through data to see if i've reached the end of the list or am missing a value.

    I was getting anamoulous results but when i changed the reference to A1 format works like a champ.

    I don't get an error when I use the "R1C1" format but it either misdirecting or simply taking the quoted entry as a text reference and thus returning FALSE because the text RICI is not blank.

    Some functions are finicky about the "R1C1" reference but i almost always need to use it as it is the only reference system I'm aware of that allows me to concatenate variables from a FOR/NEXT loop to pick different cells.

    but i can't even get this to work without variables as in just entering in a cell

    Please Login or Register  to view this content.
    it returns false even when the refernced cell is blank. (and i've tested this by using the B7 reference , e.g.

    Please Login or Register  to view this content.
    and it works perfectly)

    go figure, i hope someone does.

    thanx
    Last edited by riwiseuse; 08-24-2015 at 10:23 AM.

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

    Re: ISBLANK() not working with "R1C1" reference

    "R7C2" is a literal string, it's not a cell reference.

    Try losing the quotes.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    that only works if i change reference style in the preferences but that screws up my ability to make calls like this

    Please Login or Register  to view this content.
    where rowcount is a variable named in a FOR/NEXT loop/ can't even remember where i was first introduced to this syntax but i've always written in A1 reference mode using quoted references when i want to make R1C1 calls. So this call selects the cell i have in mind which is the empty first cell in the row i intend to interrogate. i just use the selection with a WAIT command in the macro so i can follow along and debug FOR/NEXT problems. So the quoted reference works fine for the SELECT command. But that very same syntax won't work with ISBLANK. e.g.:

    Please Login or Register  to view this content.
    it doesn't work regardless of which style reference i have selected in preferences. and the quoted selection code above works fine even when operating with A1 reference selected (which is to say R1C1 is not checked).

    I am still mystified about the background automatic naming that makes something like that selection function work (I would call it variable definition) but whatever happens during the running of the macro does not appear to outlast the macro because when i go to define names after i've run it there is no rowcount, but obviously there is one during the running of macro as it doesn't throw errors and selects the correct cell using that concatentation with the variable rowcount. (like other names, it is quoted when first called out, but after that you don't use quotes).

    I came up with a workaround for my conditional test, since i can't get that R1C1 concatenated reference to work with the ISBLANK command I simply select the cell i want to query and then use ACTIVE.CELL() as the reference for ISBLANK and then I use an OFFSET function to write the result of the function into blank space.

    Please Login or Register  to view this content.
    but i would still love to know why that reference works fine for SELECT but not for ISBLANK

    thanks,

    brian

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

    Re: ISBLANK() not working with "R1C1" reference

    Brian

    Where are you using that code/formulas?

  5. #5
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    that is an XLM macro on a macro sheet in the active workbook.

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

    Re: ISBLANK() not working with "R1C1" reference

    Thought it might be.

    Couldn't you use VBA?

    If you cant is there any XLM macro equivalent of VBA's Cells?

    Cells in VBA can be used to refer to cells using the row and column numbers, for example Cells(R, 3).

  7. #7
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    there is a CELL function that can return various aspects of cell info. takes the form =CELL("type of info", reference).

    but my problem is i need to be able to make a moving numerical reference to a cell that draws the row# from a variable in a for next loop. maybe if the CELL function would take my concatenated R1C1 reference I could then ISBLANK that return. sometimes workaround is the only thing that works although using the SELECT function which will accept a concatenated R1C1 reference has got me moving for now.

    I'll meditate on whether the CELL function could do better.

    thanks,

    brian

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

    Re: ISBLANK() not working with "R1C1" reference

    Brian

    You definitely can't use VBA for this?

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ISBLANK() not working with "R1C1" reference

    Like this but it's not very robust:

    =ISBLANK(INDIRECT("R7C2",0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  10. #10
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    Tony,

    thanks. i had forgotten about INDIRECT. I did a workaround but I think this would have worked.

    do you know of any reference that explains which functions can actually take the quoted "R1C1" reference.

    a good explanation of what circumstances excel would recognize those quotes as enclosing a reference rather than a text value would be helpful. in hind sight, i wonder why they couldn't have use scare quotes,e.g. 'R1C1' to denote that as a reference. i guess maybe too many possessives still around or something.

    but thanks much for the idea.

    brian

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ISBLANK() not working with "R1C1" reference

    Quote Originally Posted by riwiseuse View Post
    do you know of any reference that explains which functions can actually take the quoted "R1C1" reference.
    AFAIK, INDIRECT is the only function that can parse text strings into valid references.

  12. #12
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    right but some other XLM macro functions can do it. For instance SELECT as you see above in the code I included above. its short so i'll repeat for simplicity.

    Please Login or Register  to view this content.
    this runs like we the people and SELECT works perfectly with these mixed R1C1 references that start as quoted references and then drop out to include variables and then back into quotes. i have to think about what other functions work this way. I really wish their were a place for those of us still using XLM to knock this stuff around. I just like it better. I thing VBA is more powerful in some ways and when i hit the wall on something i have to do i record a macro and then see what the code looks like but i really don't feel capable of writing in it. just snipping and editing. but i really think the power of VBA comes from the community of folks who use it, not from the language itself. if there were a focused group of XLM folks we'd do OK. most things you can do with VBA can be done with XLM and its usually more concise.

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ISBLANK() not working with "R1C1" reference

    About the only XLM functions I ever use is GET.CELL and I use it in worksheet formulas.

    Do you have access to the XLM help files?

    See this:

    https://www.excelforum.com/showthread.php?p=3847562

  14. #14
    Forum Contributor
    Join Date
    09-23-2008
    Location
    Rhode Island
    MS-Off Ver
    Excel for Mac 2011 and 2007 on PC
    Posts
    265

    Re: ISBLANK() not working with "R1C1" reference

    tony,

    thanks much. i do have the microsoft "macrofun" documentation. and by bible is a nice 2nd eiditon of Excel in Business by Douglas Cobb and Allan McGuffey from 1989.
    the thing about the XLM macro language that really clicked for me is that it builds off of the skills you develop writing cell formulas.

    and it has a precise logic. syntax of course to be conquered. and it bugs the hell out of me that excel won't let me enter an incorrect formula in a macro - i get why you can't enter it in a workbork cell, because it runs right away. but in a complicated formula ( i could spend more time writing my IFs vertically, etc.) my eyes blur over or i need to go look at something else to fix the formula and i can't get out of that cell i'm writing in. instead i end up taking out the equal sign and then sometime later i spend a half hour trying to get the macro to run once i fixed the formula because i forgot to put the equal sign back in. you'd think it would be obvious but it happens over and over. and they could have better graphic debugging worked out for non-matching parentheses and or they tell you a function has too many arguments, but there are 4 functions in the cell and they don't highlight which one.

    unfortunately this will never get improved since they have abandoned it, but there is an upside to that, because there is nothing i hate more than an 'updated' version of a program i'm really comfortable with.

    thanks again for passing on info.

    brian

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: ISBLANK() not working with "R1C1" reference

    Good luck!

+ 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. = EMBED("Forms.ComboBox.1","") error "Reference not valid."
    By CatharinaCatharina in forum Excel General
    Replies: 2
    Last Post: 12-11-2014, 09:58 AM
  2. Using R1C1 formula in VBA changes all references from CELL("address") function to R1C1?
    By dmasters4919 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2014, 04:17 PM
  3. [SOLVED] IF formula not working =IF(NOT(ISBLANK(M3)),"",IF(ISBLANK(L3),"",TODAY()-L3))
    By amthyst826 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2014, 02:37 PM
  4. Replies: 9
    Last Post: 11-06-2012, 08:59 AM
  5. Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)" not working
    By redders in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2011, 03:52 PM
  6. Replies: 6
    Last Post: 09-08-2011, 02:04 PM
  7. Replies: 3
    Last Post: 04-11-2006, 08:10 PM

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