Date Question

  • Thread starter Thread starter Gina
  • Start date Start date
G

Gina

This is probably very simple, but no amount of caffeine is helping me think
this morning- so I'm hoping I can get help.

Cell A2: =YEAR(C2)
Cell B2: =INT((MONTH(C2)-1)/3)+1


These two cells return the value of Year and Quarter for a date that is
posted in Cell C2. What I'd like is to be able to have NO value returned if
there is a date in this cell. Currently if the cell is empty, Cell A2
defaults to year 1900, and Cell A3 returns 1 for 1st Quarter.
 
I think you had a typo and meant this:

Cell A2: =IF(C2="","",YEAR(C2))
Cell B2: =IF(C2="","",INT((MONTH(C2)-1)/3)+1)

Hope this helps.

Pete
 
=IF(ISNUMBER(C2),YEAR(C2),"")

Hope this helps.

Note: A date is actually just a number. You may wish to use Data Validation
to ensure a date is entered into cell C2. If you do use data validation, you
can use the following formula:
=IF(ISBLANK(C2),"",YEAR(C2))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top