+ Reply to Thread
Results 1 to 5 of 5

IF statement using number formatting for cells

  1. #1
    Registered User
    Join Date
    06-18-2019
    Location
    Dallas, Texas
    MS-Off Ver
    windows 2013
    Posts
    72

    IF statement using number formatting for cells

    Hello all,

    I am really stuck on this certain formula that I am trying to build. I am using a =IF statement

    I need (if D6=B6), True= E6-C6, and False= D6-B6

    I have the current IF Statement:
    Please Login or Register  to view this content.
    THIS IS THE CORRECT FORMULA, but I need= if True to have: number format cells set to h:mm:ss, and if False I need a whole number (for example= 4)

    I was thinking of doing a =text formula inside the IF, but I am just confused and would be grateful for any help.
    Last edited by Tgbell; 06-26-2019 at 02:42 PM.

  2. #2
    Registered User
    Join Date
    06-28-2017
    Location
    Dallas
    MS-Off Ver
    2016
    Posts
    54

    Re: IF statement using number formatting for cells

    Tgbell- you can use conditional formatting to accomplish this task. If you post a sample spreadsheet I can go in and do it for you so you can see!

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: IF statement using number formatting for cells

    In that case you will need to use conditional formatting. The cell containing this formula would have the General (default) format. You would create a rule with a formula

    =D6=B6

    Then the format you apply would be Number, Time, h:mm:ss
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    08-16-2011
    Location
    Thailand
    MS-Off Ver
    Excel 2019
    Posts
    66

    Re: IF statement using number formatting for cells

    HI,

    try this

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-18-2019
    Location
    Dallas, Texas
    MS-Off Ver
    windows 2013
    Posts
    72

    Re: IF statement using number formatting for cells

    Thank You, I kept inserting it right after I posted and the I kept forgetting the parenthesis. Thanks for the help


    What would be an easy way to autofill this formula to the last cell in a vba?
    Last edited by Tgbell; 06-26-2019 at 02:53 PM.

+ 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. [SOLVED] Apply formatting if a number repeats in one of the three cells following this number
    By ×_× in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-02-2015, 10:57 AM
  2. Formatting cells with an IF statement
    By Little mag in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2013, 07:46 AM
  3. [SOLVED] If statement for number of blank cells > 2 in a table
    By lavinius in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2013, 10:10 AM
  4. [SOLVED] How to use an IF statement to evaluate two different cells with a number and a date
    By scsuflyboy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-10-2012, 11:11 PM
  5. Apply Number format conditioning to cells that already contain If statement?
    By jsabo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2012, 03:46 PM
  6. IF Statement that compares multiple cells and gives me the lowest number
    By williamfrus in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-07-2012, 07:37 PM
  7. If Formula looking at a number of cells to return a statement
    By tylerjam1980 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2012, 11:54 AM

Tags for this Thread

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