+ Reply to Thread
Results 1 to 3 of 3

have a text cell represent a value in a formula...

  1. #1
    Registered User
    Join Date
    11-09-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    have a text cell represent a value in a formula...

    I am trying to add to this functional formula...

    =IF(24*(IF(B7>C7,C7+1-B7,C7-B7))>5,24*(IF(B7>C7,C7+1-B7,C7-B7))-0.5,24*(IF(B7>C7,C7+1-B7,C7-B7)))

    This formula calculates the total hours of two times, if the total hours are greater than 5 hours
    it deducts 30 minutes for a lunch.

    B7 and C7 have drop down list's with the follow information:

    off
    8:00 AM
    8:30 AM
    9:00 AM
    9:30 AM
    10:00 AM
    10:30 AM
    11:00 AM
    11:30 AM
    12:00 PM
    12:30 PM
    1:00 PM
    1:30 PM
    2:00 PM
    2:30 PM
    3:00 PM
    3:30 PM
    4:00 PM
    4:30 PM
    5:00 PM
    5:30 PM
    6:00 PM
    6:30 PM

    I want the formula to do the calculations, but if the cell's says "off" I want it to treat them as a value of "0".
    I want the cell's to still say "off" but have a value of "0" to complete the formula.
    How can I do this? Is it possible to use some sort of COUNTIF statement?
    Last edited by shanecline; 11-16-2012 at 04:07 PM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: have a text cell represent a value in a formula...

    Maybe..

    =IF(OR(B7="off",C7="off"),0,IF(24*(IF(B7>C7,C7+1-B7,C7-B7))>5,24*(IF(B7>C7,C7+1-B7,C7-B7))-0.5,24*(IF(B7>C7,C7+1-B7,C7-B7))))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    10-31-2012
    Location
    Maryland, USA
    MS-Off Ver
    Excel 2003/2007
    Posts
    145

    Re: have a text cell represent a value in a formula...

    You could try using
    Please Login or Register  to view this content.
    I just added an extra IF statement that returns 0 if B7 = off.


    Simeon

+ 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