Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF statement for text entry (2003 sp2)

    Good morning

    is it possible to use an IF statement to act upon text in a cell, example: I have a column in a workbook which records whether a job occured out of hours, with the statement OUT OF HOURS (this is an imported CSV workbook), in my naivity I thought that I could say something like =IF(H2="OUT OF HOURS"G2+25%), not surprsingly this does not work, is it possible and if so could you please nudge me in the right direction.

    Thank you
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: IF statement for text entry (2003 sp2)

    Something like:
    <code>=IF(H2="OUT OF HOURS",G2*125%,G2)</code>
    ?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF statement for text entry (2003 sp2)

    Thanks Rory

    I can't beleive I was close!!,

    How can I exclude a value being entered that was not out of hours because with this statement if something was out of hours it adds the 25% and shows the total, if it was not out of hours it is showing the actual delivery charge and I wanted this column to only show the Out of hours ones. If that involves too much extra work I will just make the text white in the cells not required, thanks

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: IF statement for text entry (2003 sp2)

    You can either replace the G2 at the end with "" or with 0:
    <code>=IF(H2="OUT OF HOURS",G2*125%,"")</code>
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •