+ Reply to Thread
Results 1 to 2 of 2

How to calculate number of days with two different conditions

  1. #1
    Registered User
    Join Date
    10-24-2011
    Location
    Pensacola, Florida
    MS-Off Ver
    Excel 2007
    Posts
    15

    How to calculate number of days with two different conditions

    To All

    I am having a problem in trying to calculate the number of days under two conditions into the same cell.
    I have posted below an example of the information all within the same row, but in different columns as noted and what is actually trying to be accomplished.

    Cell B date (example:01/07/2013)
    Cell D could be "G" or "F"
    Cell F date (example:11/29/2012)
    Cell I date (example:01/05/2013)
    Cell M number of days and location of formula needed (see example below)

    to cell M if Cell D is a "G" then the number of days between Cell B and Cell G
    BUT
    to cell M if Cell D is a "F" then the number of days between Cell G and Cell I

    I want to Thank those that help with this problem.

    Sincerely
    Last edited by Autin; 01-08-2013 at 03:32 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,982

    Re: How to calculate number of days with two different conditions

    Assume data is in Row 4, then

    =IF(D4="G",B4-G4,IF(D4="F",I4-G4,"")) If cell D4 is neither an F or G, then the formula returns a blank. In your example you had no data in column G.

    Tutorial on Nested IF statements
    http://www.techonthenet.com/excel/fo.../if_nested.php
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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