+ Reply to Thread
Results 1 to 4 of 4

Writing 2 formulas within one cell

  1. #1
    Registered User
    Join Date
    12-02-2014
    Location
    U.S.
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Writing 2 formulas within one cell

    Hello!

    I am trying to write 2 formulas within 1 cell. I have used the comma to separate, but continuously get an error message. I am using dates to calculate the time it takes to complete a work order: =sum(e562-d562)

    However, for those work orders that are not completed yet, I need a specific number '8' to be in that column.

    I have tried this:
    =sum(e562-d562),=orif(e562="","8") This returns an error. If I delete the comma, it gives me a #NAME? error. I am so confused now! I need it to say:

    the difference of e562-d562, or if there is nothing in e562 return an answer of 8.

    Please and Thank You in Advance for any help!

  2. #2
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Writing 2 formulas within one cell

    You do OR first for or statements...

    =OR(LogicA,LogicB)
    Which can be used inside of other logic statements -


    Now that is not what you need here...

    You need
    Please Login or Register  to view this content.
    Which says, If the contents of E562 is equal to "" than display 8, otherwise if it is Not "" than display the difference of E562-D562
    -If you think you are done, Start over - ELeGault

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Writing 2 formulas within one cell

    Post #2 is what you need.

    However, to explain how/when OR would be used in your question...

    You want to test to see if work orders that are completed, and lets also add in, the WO value has to be over $500...if not, then return the number '8' to be in that column.

    That would look like this...
    =IF(AND(e562<>"",e562-d562>500),e562-d562,8)
    This is testing to make sure that E is not empty AND that E-D is > 500

    You could replace the AND with OR if you needed either of those to be true, rather than both needing to be true
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    12-02-2014
    Location
    U.S.
    MS-Off Ver
    MS Office 2010
    Posts
    7

    Re: Writing 2 formulas within one cell

    Thank you so much! It worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Writing Table Formulas Using VBA
    By kestefon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2013, 06:08 PM
  2. [SOLVED] writing in formulas - getting errors
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2012, 11:42 AM
  3. navigating while writing cell formulas - any way to modify default functionality?
    By riwiseuse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-20-2011, 08:32 AM
  4. [SOLVED] writing formulas in VB - referring to the values contained in cell
    By Josie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2006, 02:40 PM
  5. Writing formulas ...
    By Sige in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-27-2005, 10:05 AM

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