Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 122
Default Sumproduct Date Format Question

I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? Excel 2007

Thanks a bunch everyone!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,089
Default Sumproduct Date Format Question

What is in cell B3? What are the ranges Year, Store and Sales and what data
do they contain? A few samples would help.

Regards


"wx4usa" wrote in message
...
I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? Excel 2007

Thanks a bunch everyone!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default Sumproduct Date Format Question

Hi
Substiture b1 with:

Year(A1)

=SUMPRODUCT(--(Year=YEAR(A1)),--(Store=B3),SALES)

Regards,
Per

"wx4usa" skrev i meddelelsen
...
I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? Excel 2007

Thanks a bunch everyone!


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 122
Default Sumproduct Date Format Question

On Oct 14, 3:00*pm, "Per Jessen" wrote:
Hi
Substiture b1 with:

Year(A1)

=SUMPRODUCT(--(Year=YEAR(A1)),--(Store=B3),SALES)

Regards,
Per

"wx4usa" skrev i ...

I have a date in cell a1 such as 09/08/09


I have a helper cell b1 that is =Text(a1,"YYYY")


B1 displays 2009


In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)


I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.


What can I do to leave the text formula in? *Excel 2007


Thanks a bunch everyone!


Very good...that works great Per Jessen!!!
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 153
Default Sumproduct Date Format Question

Reading between the lines, I'm guessing that the part about (year=b1)
is comparing a number with text string, something to be avoided.

Maybe it'd help to use (year=VALUE(b1)) instead.

Personally, my preference would be to use (year=YEAR(A1)) and dispense
with b1 (if you don't need b1 for other things).

If you keep b1, decide if it needs to be text
=Text(a1,"YYYY")
or numeric
=YEAR(a1)


On Oct 14, 11:36*am, wx4usa wrote:
I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? *Excel 2007




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 320
Default Sumproduct Date Format Question

change year=b1 to year=b1*1
or change the cell in B1 to read =YEAR(A1) so it's still numeric
Bob Umlas
Excel MVP

"wx4usa" wrote in message
...
I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? Excel 2007

Thanks a bunch everyone!



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Sumproduct Date Format Question

I have a helper cell b1 that is =Text(a1,"YYYY")
B1 displays 2009


The result of the TEXT formula is a *text* value even though it looks like
the number 2009. So, you'd have to convert the text value 2009 to the
numeric value 2009.

One way to do that is like this:

=--Text(a1,"YYYY")

--
Biff
Microsoft Excel MVP


"wx4usa" wrote in message
...
I have a date in cell a1 such as 09/08/09

I have a helper cell b1 that is =Text(a1,"YYYY")

B1 displays 2009

In a cell b8, I have the following =sumproduct((year=b1)*(store=b3)*
(sales)

I get an error. When I simply enter the year into b1 without the text
formula, I get the correct sumproduct results.

What can I do to leave the text formula in? Excel 2007

Thanks a bunch everyone!



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
Sumproduct and Date format wx4usa Excel Discussion (Misc queries) 8 December 13th 08 04:51 PM
Sumproduct and Date format wx4usa Excel Discussion (Misc queries) 1 December 13th 08 04:01 PM
question SUMPRODUCT format Susan Excel Worksheet Functions 3 January 17th 08 08:33 PM
Date format Question Fable Excel Discussion (Misc queries) 1 December 1st 05 01:18 PM
SUMPRODUCT with date range question Rob V Excel Discussion (Misc queries) 1 January 31st 05 03:55 PM


All times are GMT +1. The time now is 08:12 PM.

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"