Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Need IF/THEN formula for date present

I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that part I
have) AND IF there is NOT a date in date column 2, subtract date column 1
from TODAY's date. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Need IF/THEN formula for date present

Try somehting like this:

=IF(B2,B2,TODAY())-A2

Or, for something more robust:

=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")

Format as GENERAL or NUMBER

--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that part I
have) AND IF there is NOT a date in date column 2, subtract date column 1
from TODAY's date. Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Need IF/THEN formula for date present

You are truly a genius - it works beautifully - thanks!!!

"T. Valko" wrote:

Try somehting like this:

=IF(B2,B2,TODAY())-A2

Or, for something more robust:

=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")

Format as GENERAL or NUMBER

--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that part I
have) AND IF there is NOT a date in date column 2, subtract date column 1
from TODAY's date. Thanks!




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Need IF/THEN formula for date present

You're welcome. Thanks for the feedback!

Or, for something more robust:
=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")


Same result, a few keystrokes shorter:

=IF(COUNT(A2),IF(COUNT(B2),B2,TODAY())-A2,"")


--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
You are truly a genius - it works beautifully - thanks!!!

"T. Valko" wrote:

Try somehting like this:

=IF(B2,B2,TODAY())-A2

Or, for something more robust:

=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")

Format as GENERAL or NUMBER

--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that
part I
have) AND IF there is NOT a date in date column 2, subtract date column
1
from TODAY's date. Thanks!






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Need IF/THEN formula for date present

Or, for something more robust:
=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")


Same result, a few keystrokes shorter:

=IF(COUNT(A2),IF(COUNT(B2),B2,TODAY())-A2,"")


If we make the assumption that if a date exists in B2, that it will always
be an earlier date than today, then we can save a few more keystrokes...

=IF(COUNT(A2),MIN(B2,TODAY())-A2,"")

or, if not always earlier, then if we assume it is always after today,
then...

=IF(COUNT(A2),MAX(B2,TODAY())-A2,"")

Rick



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Need IF/THEN formula for date present

T. Valko - oletko suomalainen? Jos olet, niin osaatko kertoa kuinka
suomenkielisessä Excelissä lasketaan montako riviä sisältää molemmat tiedot
esim. "ovi" ja "kimi"?

ovi ikkuna anssi kimi
seinä aita sipa tommi
taulu kaappi vesa mikko
ikkuna ovi anssi kimi
aita seinä sipa tommi
kaappi taulu vesa mikko
ovi ikkuna anssi kimi
seinä aita sipa tommi
taulu kaappi vesa mikko

--
- Anssi -


"T. Valko" kirjoitti:

You're welcome. Thanks for the feedback!

Or, for something more robust:
=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")


Same result, a few keystrokes shorter:

=IF(COUNT(A2),IF(COUNT(B2),B2,TODAY())-A2,"")


--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
You are truly a genius - it works beautifully - thanks!!!

"T. Valko" wrote:

Try somehting like this:

=IF(B2,B2,TODAY())-A2

Or, for something more robust:

=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")

Format as GENERAL or NUMBER

--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that
part I
have) AND IF there is NOT a date in date column 2, subtract date column
1
from TODAY's date. Thanks!






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Need IF/THEN formula for date present

I only understand English (sometimes!).

--
Biff
Microsoft Excel MVP


"Anssi" wrote in message
...
T. Valko - oletko suomalainen? Jos olet, niin osaatko kertoa kuinka
suomenkielisessä Excelissä lasketaan montako riviä sisältää molemmat
tiedot
esim. "ovi" ja "kimi"?

ovi ikkuna anssi kimi
seinä aita sipa tommi
taulu kaappi vesa mikko
ikkuna ovi anssi kimi
aita seinä sipa tommi
kaappi taulu vesa mikko
ovi ikkuna anssi kimi
seinä aita sipa tommi
taulu kaappi vesa mikko

--
- Anssi -


"T. Valko" kirjoitti:

You're welcome. Thanks for the feedback!

Or, for something more robust:
=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")


Same result, a few keystrokes shorter:

=IF(COUNT(A2),IF(COUNT(B2),B2,TODAY())-A2,"")


--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
You are truly a genius - it works beautifully - thanks!!!

"T. Valko" wrote:

Try somehting like this:

=IF(B2,B2,TODAY())-A2

Or, for something more robust:

=IF(COUNT(A2),IF(ISNUMBER(B2),B2,TODAY())-A2,"")

Format as GENERAL or NUMBER

--
Biff
Microsoft Excel MVP


"Amatuer" wrote in message
...
I'm sure this is basic for most of you but it is baffling me:

I need a formula to subtract date column 1 from date column 2 (that
part I
have) AND IF there is NOT a date in date column 2, subtract date
column
1
from TODAY's date. Thanks!








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
present value formula SUMIF Excel Worksheet Functions 2 September 26th 06 03:28 PM
how do I automatically jump to the present date in a roster? awvanheerde Excel Worksheet Functions 3 July 19th 06 03:53 PM
calculating month of present date anu_manu Excel Discussion (Misc queries) 5 February 24th 06 07:04 PM
How do I show dates older than present date? Sissyfirst Excel Worksheet Functions 1 July 12th 05 09:56 PM
Understanding net present value formula in Excel kathy304 Excel Worksheet Functions 1 February 1st 05 07:15 PM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"