+ Reply to Thread
Results 1 to 2 of 2

add a formula to a formula

  1. #1
    Registered User
    Join Date
    02-25-2005
    Posts
    38

    add a formula to a formula

    i want to add to formula t

    in column c1 there is a formula

    =a1/b1 (let say formula is: x)

    but x gives error (division by zero) in some cells

    i want to add

    =IF(ISERROR(FORMULA A);"N.M.";(FORMULA A))

    is this possible

    it will be too difficult maybe impossible for me to write every cell different formulas
    (the formula not the same in that whole worksheet)

  2. #2
    Chip Pearson
    Guest

    Re: add a formula to a formula

    Select the cells you want to change, then run the following code:

    Sub AAA()
    Dim Rng As Range
    For Each Rng In Selection.SpecialCells(xlCellTypeFormulas).Cells
    Rng.Formula = "=IF(ISERROR(" & Mid(Rng.Formula, 2) & _
    "),""N.M""," & Mid(Rng.Formula, 2) & ")"
    Next Rng
    End If


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "barkiny" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > i want to add to formula t
    >
    > in column c1 there is a formula
    >
    > =a1/b1 (let say formula is: x)
    >
    > but x gives error (division by zero) in some cells
    >
    > i want to add
    >
    > =IF(ISERROR(FORMULA A);"N.M.";(FORMULA A))
    >
    > is this possible
    >
    > it will be too difficult maybe impossible for me to write every
    > cell
    > different formulas
    > (the formula not the same in that whole worksheet)
    >
    >
    > --
    > barkiny
    > ------------------------------------------------------------------------
    > barkiny's Profile:
    > http://www.excelforum.com/member.php...o&userid=20397
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=492690
    >




+ 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