Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default How to leave a formula cell blank when it has no calculation to make


HI

In column A I have a list of people's birthdays in dd/mm/yy format.

In column B I'm calculating their age using this formula :

=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months,
" & DATEDIF(A1,NOW(),"md") & " days"

This returns a string like

33 years, 9 months, 18 days

I am dragging this down to fill B1 - B25 and it works fine where the
cells in column A have content.

The question I have is this : How can I get the cells in column B to
remain blank where column A has no content? There are 25 spaces for
dates of birth in column A, but I'm only using 15 at the moment.

I'm not using A16 - A25 , so B16 - B25 should be blank until I do add
content. However , the formula in B16 - B25 is giving random ages when
nothing is showing in the equivalent cells in A.

Can any one help with a formula to have cells in B remain blank until A
has content?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default How to leave a formula cell blank when it has no calculation to make

Colin, like this,
=IF(A1="","",DATEDIF(A1,NOW(),"y")&" years, "&DATEDIF(A1,NOW(),"ym")&"
months,"&DATEDIF(A1,NOW(),"md")&" days")

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Colin Hayes" wrote in message
...

HI

In column A I have a list of people's birthdays in dd/mm/yy format.

In column B I'm calculating their age using this formula :

=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months,
" & DATEDIF(A1,NOW(),"md") & " days"

This returns a string like

33 years, 9 months, 18 days

I am dragging this down to fill B1 - B25 and it works fine where the
cells in column A have content.

The question I have is this : How can I get the cells in column B to
remain blank where column A has no content? There are 25 spaces for
dates of birth in column A, but I'm only using 15 at the moment.

I'm not using A16 - A25 , so B16 - B25 should be blank until I do add
content. However , the formula in B16 - B25 is giving random ages when
nothing is showing in the equivalent cells in A.

Can any one help with a formula to have cells in B remain blank until A
has content?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default How to leave a formula cell blank when it has no calculation to ma

Try this:

=IF(N(A1),DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & "
months, " & DATEDIF(A1,NOW(),"md") & " days","")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Colin Hayes" wrote:


HI

In column A I have a list of people's birthdays in dd/mm/yy format.

In column B I'm calculating their age using this formula :

=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months,
" & DATEDIF(A1,NOW(),"md") & " days"

This returns a string like

33 years, 9 months, 18 days

I am dragging this down to fill B1 - B25 and it works fine where the
cells in column A have content.

The question I have is this : How can I get the cells in column B to
remain blank where column A has no content? There are 25 spaces for
dates of birth in column A, but I'm only using 15 at the moment.

I'm not using A16 - A25 , so B16 - B25 should be blank until I do add
content. However , the formula in B16 - B25 is giving random ages when
nothing is showing in the equivalent cells in A.

Can any one help with a formula to have cells in B remain blank until A
has content?

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default How to leave a formula cell blank when it has no calculation to make

One way:

B1: =IF(A1="","",<current formula)

In article ,
Colin Hayes wrote:

HI

In column A I have a list of people's birthdays in dd/mm/yy format.

In column B I'm calculating their age using this formula :

=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months,
" & DATEDIF(A1,NOW(),"md") & " days"

This returns a string like

33 years, 9 months, 18 days

I am dragging this down to fill B1 - B25 and it works fine where the
cells in column A have content.

The question I have is this : How can I get the cells in column B to
remain blank where column A has no content? There are 25 spaces for
dates of birth in column A, but I'm only using 15 at the moment.

I'm not using A16 - A25 , so B16 - B25 should be blank until I do add
content. However , the formula in B16 - B25 is giving random ages when
nothing is showing in the equivalent cells in A.

Can any one help with a formula to have cells in B remain blank until A
has content?

Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default How to leave a formula cell blank when it has no calculation to make


Hi

OK Thanks for your answers - all work perfectly. Much obliged for your
help and expertise.


Best Wishes


Colin





In article , JE
McGimpsey writes
One way:

B1: =IF(A1="","",<current formula)

In article ,
Colin Hayes wrote:

HI

In column A I have a list of people's birthdays in dd/mm/yy format.

In column B I'm calculating their age using this formula :

=DATEDIF(A1,NOW(),"y") & " years, " & DATEDIF(A1,NOW(),"ym") & " months,
" & DATEDIF(A1,NOW(),"md") & " days"

This returns a string like

33 years, 9 months, 18 days

I am dragging this down to fill B1 - B25 and it works fine where the
cells in column A have content.

The question I have is this : How can I get the cells in column B to
remain blank where column A has no content? There are 25 spaces for
dates of birth in column A, but I'm only using 15 at the moment.

I'm not using A16 - A25 , so B16 - B25 should be blank until I do add
content. However , the formula in B16 - B25 is giving random ages when
nothing is showing in the equivalent cells in A.

Can any one help with a formula to have cells in B remain blank until A
has content?

Thanks.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default How to leave a formula cell blank when it has no calculation to make

In article , Paul B
writes
Colin, like this,
=IF(A1="","",DATEDIF(A1,NOW(),"y")&" years, "&DATEDIF(A1,NOW(),"ym")&"
months,"&DATEDIF(A1,NOW(),"md")&" days")


Hi again

Just an extra thought :

As an extension to this , can this formula be extended to compare 2
cells?

In column A I have a date (dd/mm/yy) when people joined a scheme.

In column B I have the date (dd/m/yy) they left the scheme. If they are
still in the scheme , this is blank because they are still current.

Could I show in column C therefore how long in years months and days
they were in the scheme?

The formula would assume that if the cell in the column B were blank ,
then they are still in the scheme and would give length of time to NOW()
, If there is content in B that it needs to take one from the other to
give the length in C.

Can this be done via formula?

Grateful for any help.

Best Wishes


Colin
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default How to leave a formula cell blank when it has no calculation to make

Colin, try this,

=IF(A1="","",IF(B1="",DATEDIF(A1,NOW(),"y")&" years,
"&DATEDIF(A1,NOW(),"ym")&" months,"&DATEDIF(A1,NOW(),"md")&"
days",DATEDIF(A1,B1,"y")&" years, "&DATEDIF(A1,B1,"ym")&"
months,"&DATEDIF(A1,B1,"md")&" days"))

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Colin Hayes" wrote in message
...
In article , Paul B
writes
Colin, like this,
=IF(A1="","",DATEDIF(A1,NOW(),"y")&" years, "&DATEDIF(A1,NOW(),"ym")&"
months,"&DATEDIF(A1,NOW(),"md")&" days")


Hi again

Just an extra thought :

As an extension to this , can this formula be extended to compare 2
cells?

In column A I have a date (dd/mm/yy) when people joined a scheme.

In column B I have the date (dd/m/yy) they left the scheme. If they are
still in the scheme , this is blank because they are still current.

Could I show in column C therefore how long in years months and days
they were in the scheme?

The formula would assume that if the cell in the column B were blank ,
then they are still in the scheme and would give length of time to NOW()
, If there is content in B that it needs to take one from the other to
give the length in C.

Can this be done via formula?

Grateful for any help.

Best Wishes


Colin



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default How to leave a formula cell blank when it has no calculation to make

In article , Paul B
writes
Colin, try this,

=IF(A1="","",IF(B1="",DATEDIF(A1,NOW(),"y")&" years,
"&DATEDIF(A1,NOW(),"ym")&" months,"&DATEDIF(A1,NOW(),"md")&"
days",DATEDIF(A1,B1,"y")&" years, "&DATEDIF(A1,B1,"ym")&"
months,"&DATEDIF(A1,B1,"md")&" days"))


Hi Paul

Thanks very much for that - it's exactly what I needed. Works perfectly
first time.

Whatever they're paying you , it's not enough!


Best Wishes


Colin
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default How to leave a formula cell blank when it has no calculation to make

Colin, glad I could help, just so you know nobody gets paid to answer any
questions here

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Colin Hayes" wrote in message
...
In article , Paul B
writes
Colin, try this,

=IF(A1="","",IF(B1="",DATEDIF(A1,NOW(),"y")&" years,
"&DATEDIF(A1,NOW(),"ym")&" months,"&DATEDIF(A1,NOW(),"md")&"
days",DATEDIF(A1,B1,"y")&" years, "&DATEDIF(A1,B1,"ym")&"
months,"&DATEDIF(A1,B1,"md")&" days"))


Hi Paul

Thanks very much for that - it's exactly what I needed. Works perfectly
first time.

Whatever they're paying you , it's not enough!


Best Wishes


Colin



  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 465
Default How to leave a formula cell blank when it has no calculation to make

In article , Paul B
writes
Colin, glad I could help, just so you know nobody gets paid to answer any
questions here


Hi Paul

Yes - I did know that. It's just an expression...

^_^

Colin
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
Formula <0 leave cell blank Whit Excel Discussion (Misc queries) 3 August 13th 06 02:47 AM
To leave a blank cell Steved Excel Worksheet Functions 6 July 18th 06 03:37 AM
Formula and Condition for a Calculation to leave a zero if the res SSG Devine Excel Worksheet Functions 3 March 13th 06 06:55 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
leave a cell blank nicolas Excel Worksheet Functions 1 August 2nd 05 01:55 PM


All times are GMT +1. The time now is 06:29 AM.

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

About Us

"It's about Microsoft Excel"