+ Reply to Thread
Results 1 to 13 of 13

Run Formula only if Cell has certain Criteria

  1. #1
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Run Formula only if Cell has certain Criteria

    Hi,

    I have a s/s and would like certain forumla's to display in certain cells contain the criteria in order for the formula to run.

    i.e. If a date is displayed (any date) in Cell D106 (this could alter as the data is dynamic, it could be D107 in another instance).,I would like a forumal to automatically run in cell O106 (If the data is in D107 then the corropsonding O107 would display the forumla).

    Currently, When I copy and paste the formula over multiple cells, the forumla displays in every cell and sometimes does not work as there isn't a pattern of the same data in the correct cells for the forumla to run. Please see attached screen shot for better illustration.

    Any help is much appreciated,
    Attached Images Attached Images
    Last edited by karobonas; 01-07-2011 at 12:21 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Run Formula only if Cell has certain Criteria

    Maybe

    If(ISBLANK(A1),"", formula)
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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

    Re: Run Formula only if Cell has certain Criteria

    Preface the main formula with a condition to check if the cell in D is blank.

    e.g =IF(D106="","",your_formula).
    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.

  4. #4
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Run Formula only if Cell has certain Criteria

    Quote Originally Posted by NBVC View Post
    Preface the main formula with a condition to check if the cell in D is blank.

    e.g =IF(D106="","",your_formula).
    Hi,

    thank you for your quick response....

    =IF(D106="","",your_formula). did work although only for one of my formula's. I have other formula's below that I applied your code to but these failed to copy in the same way due to the corropsonding cells not necessarily containing the information (as the data can move around).... is there anyway to apply the formula so I can mass copy them through the spreadsheet.... also, I may be addition some more formula to the s/s so may need to do these same with this.

    Thanks again for your quick reply, much appreciated.

    Regards

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Run Formula only if Cell has certain Criteria

    You probably need to read up on Absolute & Relative references

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

    Re: Run Formula only if Cell has certain Criteria

    You would have to apply it to one cell, and copy the formula down/up/left/right, as long as there is consistency in adjacent formula... otherwise you can not really mass update.

    If you attach actual workbook, instead of picture, it would be easier to see why the formula does not work in other cells as you claim.

  7. #7
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Run Formula only if Cell has certain Criteria

    Quote Originally Posted by NBVC View Post
    You would have to apply it to one cell, and copy the formula down/up/left/right, as long as there is consistency in adjacent formula... otherwise you can not really mass update.

    If you attach actual workbook, instead of picture, it would be easier to see why the formula does not work in other cells as you claim.
    Hi,

    Please see attched work book... Please navigate to the 'Resource Planning'.

    Thanks again for your help.
    Attached Files Attached Files

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

    Re: Run Formula only if Cell has certain Criteria

    Where is the issue?

  9. #9
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Run Formula only if Cell has certain Criteria

    Quote Originally Posted by NBVC View Post
    Where is the issue?
    Hi,

    apologies - Under the field "Duration of Project" I have a forumla that dispalys the duration of a project. Underneath that is a formula (not obvious) that displays a numeric value dependant on "day priority" and beneath that another formula that displays a numeric value based on number of weeks using the Start Data and End Date fields.

    The data comes from a pivot table.... Dependent on the values in the data, the cells may expand or decrease meaning that the cell references in the formula may alter. I only want the formula's to display in the adjacent fields - Duration y,m,d next to the End Date, Numeric percentage next to Day Prority and no. of weeks Next to Sal Forecast Effort But all results are to be placed under the 'Duration of Project' column.... If I attempt to copy this format through all the fields.... It does not copy correctly due to the distance between the last entry and the next one either decreasing or increasing in cell's (i.e. 7 between the end date of Andy Otley and the next entry under Andy Otley and 8 cells between the last entry of Andy Otley and the next entry of Charles Plesh).

    I would like the formula to be consistant with the data that it looks at and be placed in the corropsonding fields listed above, if this is possible?

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

    Re: Run Formula only if Cell has certain Criteria

    I am not sure if this is what you mean?

    Try this formula in O7:

    Please Login or Register  to view this content.
    copied down the whole column.

    Is that it?

  11. #11
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Run Formula only if Cell has certain Criteria

    Quote Originally Posted by NBVC View Post
    I am not sure if this is what you mean?

    Try this formula in O7:

    Please Login or Register  to view this content.
    copied down the whole column.

    Is that it?
    Thats it!!! perfect. Thank you ever so much.

    just for future reference, if I wanted to add more formula to the cells below... how would I encorporate this into your formula above?

    Thank you again for your help.

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

    Re: Run Formula only if Cell has certain Criteria

    Add another Nested IF before the last double quote combo ( "" ).... but note that in Excel 2003 or earlier, you are only allowed up to 7 nested function combinations in a formula.

    If you have more, you will need to look at alternative ways to construct the formula or move to XL2007.

  13. #13
    Registered User
    Join Date
    12-01-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Run Formula only if Cell has certain Criteria

    Quote Originally Posted by NBVC View Post
    Add another Nested IF before the last double quote combo ( "" ).... but note that in Excel 2003 or earlier, you are only allowed up to 7 nested function combinations in a formula.

    If you have more, you will need to look at alternative ways to construct the formula or move to XL2007.
    Ok,

    Thank you again.

    Kind Regards,

    KB

+ 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