+ Reply to Thread
Results 1 to 5 of 5

Named ranges as values of IF function

  1. #1
    Registered User
    Join Date
    10-31-2010
    Location
    London
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    56

    Named ranges as values of IF function

    Hi All,

    I am trying to set a named range to be either one of two named ranges depending on an IF condition. So I have two named ranges called Abacus12 and Abacus24. Now if Abacus24 is empty I want to assign the named range Abacus to be 'Abacus12' and if not to Abacus 24.

    The formula I am trying to define named range Abacus in name manager is

    =IF(ISBLANK(Abacus24),Abacus12,Abacus24)

    which is giving me a #NAME? error.

    Any ideas how I can make this work?

    Thanks
    Last edited by goels; 10-21-2011 at 11:52 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Named ranges as values of IF function

    Try:

    =IF(COUNTA(Abacus24)=0,Abacus12,Abacus24)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    10-31-2010
    Location
    London
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    56

    Re: Named ranges as values of IF function

    ISBLANK is not a problem, that works fine. The issue is excel does not seem to like giving named ranges as values in the IF formula; atleast not in the format I am trying. So how can I pass the named ranges Abacus12 or Abacus24 depending on the outcome of the IF function to the named range Abacus?

    Thx

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Named ranges as values of IF function

    The ISBLANK() only tests one cell.....

    When I created named Range: Abacus with formula: =IF(COUNTA(Abacus24)=0,Abacus12,Abacus24)

    I tested with formula in a cell: =COUNT(Abacus)

    I entered numbers in my Abacus24 range and got expected result... I deleted those and entered numbers in Abacus12 range and got expected result.... If I have numbers in both ranges, the Abacus24 range took precedence.

  5. #5
    Registered User
    Join Date
    10-31-2010
    Location
    London
    MS-Off Ver
    Excel 2007, Excel 2010
    Posts
    56

    Re: Named ranges as values of IF function

    Genius! Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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