If Statements...

D

Delaina

I have this if statement:

=if(sum(e6=20040101:20040331),"1",if(sum(e6=20040401:20040630),"2",if(sum(e6=20040701:20040930),"3",if(sum(e6=20041001:20041231),"4","not
this year"))))

I am not quite a beginner, but I'm not an expert either. You can
probably guess what I am trying to do..but if not, here's what I'm
trying to accomplish.

If the sum of e6 equals any number from 20040101 to 20040331 then
produce a 1 in the cell, if not, blah blah..you get it.

What am I missing?

Thanks!
 
B

barrfly

It looks like you are trying to evaluate the annual quarter of a cel
date if it is during the year of 2004. Try this formula.

=IF(YEAR(E6)<>2004,"not",ROUNDUP(MONTH(E6)/3,0)
 
D

Delaina

Not exactly. I have a report that gives me the date but kind of
inverted...20041102
would be November 2nd 2004. I am trying to produce the quarter that the
month is in..ex: November is 4th qtr. So the cell I am working off of
contains the numbers in the above format.

I tried the formula given gave me the #num error..
 
B

barrfly

try this

=IF(LEFT(E6,4)<>"2004","not",ROUNDUP(MID(E6,5,2)/3,0))

the yyyymmdd format is just not the way excel sees dates. This
solution should work. Let me know if this works out!
 
Top