+ Reply to Thread
Results 1 to 7 of 7

Thread: duplicate formulas in same cell.

  1. #1
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    duplicate formulas in same cell.

    Question for you wizards out there. I find myself having duplicate formulas in a cell a lot.

    if(countifs(Sheet1!A:A,Sheet2!A2,Sheet1!B:B,Sheet2!B2)>0,countifs(Sheet1!A:A,Sheet2!A2,Sheet1!B:B,Sheet2!B2),"No Instances")
    This is a simple example. I also use this to see if something evaluates to a #N/A or #REF (aka error handling) as well as other applications. Is there a way to evalulate a statement and put cell output in the cell based on one evaluation instead of nesting the formulas like this? Using something like substitute or any other function I am not familiar with?

    thanks in advance.
    Last edited by olsoniv; 03-09-2011 at 01:22 PM.

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

    Re: duplicate formulas in same cell.

    Excel 2007 and newer has an IFERROR(function,error_result) function that allows you to enter the evaluation function once.

    You can perhaps add helper columns with simplified formulas, then base results on the helpers with simple formula like =Count() or simpler Countif().

    Some functions like Countif, Countifs, Sumif, Sumifs, etc are efficient enough that it doesn't hurt to repeat them in the formula... if there is no simpler way to determine condition status.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: duplicate formulas in same cell.

    Thanks NBVC. I can at least get rid of all those duplicates on error handling. So, with IFERROR, will that catch #N/A's, #REF's #NAME, and #VALUE?

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

    Re: duplicate formulas in same cell.

    Quote Originally Posted by olsoniv View Post
    So, with IFERROR, will that catch #N/A's, #REF's #NAME, and #VALUE?
    yes All of those and more:

    The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: duplicate formulas in same cell.

    I just tried to use iserror (I'm on excel 2010), it only has one input value and evaluates to true or false. Is there another version I should be using? I checked the online help and it only lists it has having one input value....

  6. #6
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,637

    Re: duplicate formulas in same cell.

    It's IFERROR not ISERROR
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    03-05-2007
    Location
    Colorado Springs, CO
    MS-Off Ver
    2010
    Posts
    45

    Re: duplicate formulas in same cell.

    whoops...thanks! *sheepish grin*

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0