+ Reply to Thread
Results 1 to 4 of 4

Formula in Excel not recognizing other named formulas

  1. #1
    Registered User
    Join Date
    12-30-2009
    Location
    Madison, WI, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Formula in Excel not recognizing other named formulas

    Hey y'all-

    I'm new to this site and was really hoping someone could help me with this one.

    I've got an Excel 2003 sheet where column E has a 6-digit code input into it. I'm able to right a function off that code that outputs if E2 (for example) equals 123456 then H2 outputs "Dog," if E2 equals 123457 then H2 outputs "Cat," and so on until I reach the max of 7 nested functions. Problem is, I have a lot more than 7 codes that I need to analyze. This Excel sheet will be used every two weeks, with lots of codes input that need to have what the code means output. I created a named formula called "part1" where:

    =if(sheet1!E2=123456,"Dog",if(sheet1!E2=123457,"Cat", etc. It didn't work when I had $ in front of E & 2.

    All variables in "part1" work when tested where H2 = part1

    I created a "part2" with more variables, checked each and it works too.

    My problem now is that when I have H2 set to =if(part1,part1,part2) to test all the variables, it'll work on any variable in "part2" but not in "part1."

    Any help would be much appreciated!
    Last edited by new tech guy; 12-31-2009 at 04:42 PM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Formula in Excel not recognizing other named formulas

    Looks like a good use for a UDF
    for example
    Please Login or Register  to view this content.
    Last edited by pike; 12-30-2009 at 06:03 PM. Reason: edit code
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Formula in Excel not recognizing other named formulas

    Hi new tech guy,

    welcome to the forum.

    I think you may be better off constructing a table with your numbers in one column and the text in the adjacent column, like this

    Please Login or Register  to view this content.
    Say this list is 100 rows long ..

    Then, when you enter a number in, say C2, you can have this formula in D2 to return the appropriate text

    =vlookup(C2,$A$1:$B$100,2,false)

    does that help?
    Last edited by teylyn; 12-31-2009 at 07:22 PM. Reason: typo

  4. #4
    Registered User
    Join Date
    12-30-2009
    Location
    Madison, WI, USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Formula in Excel not recognizing other named formulas

    vlookup did the trick.

    Thanks!

+ 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