+ Reply to Thread
Results 1 to 7 of 7

If if?

  1. #1
    Registered User
    Join Date
    06-16-2011
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    7

    If if?

    I have an IF formula to calculate hrs worked but would like to keep the cell blank if there are no values entered in other cell on row (FINISH in this example).

    =IF([@Finish]<[@Start], 1-[@Start]+[@Finish], [@Finish]-[@Start])

    So i would like to add another argument where =IF[@FINISH]="", THEN""

    How do i combine the two into 1?
    Last edited by TheBarran; 06-22-2011 at 06:26 AM.

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

    Re: If if?

    Hello,

    try

    =IF([@Finish]="","",IF([@Finish]<[@Start], 1-[@Start]+[@Finish], [@Finish]-[@Start]))

    cheers,

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: If if?

    Hi TheBarran,

    The formulas you suggest and teylyn improved only works if you have defined your data as a TABLE and you are using Excel 2007 or newer. See http://office.microsoft.com/en-us/ex...010155686.aspx
    For the fancy name of Structured References when dealing with Excel Tables.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: If if?

    Marvin, I assume that TheBarran pasted the formula straight out of the spreadsheet, so it looks as if the Table is already being used.

  5. #5
    Registered User
    Join Date
    06-16-2011
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: If if?

    Teylyn you're right on both accounts ty.

  6. #6
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: If if?

    Hi

    You can simplify your formula to


    =IF([@Finish]="","",MOD([@Finish]-[@Start]),1)
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: If if?

    Hi teylyn,

    I've been fooled by structured references a few times when converting a range to a table and then back to a range. See the example and see how the formulas flip one way but not back. My answer was warning that the table formulas would convert to range but not back if OP converted.

    see the example and convert the table to a range and back a few times and look at the formulas in column D.
    Attached Files Attached Files

+ 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