Solved

DateValue function

Posted on 2013-12-13
6
338 Views
Last Modified: 2013-12-14
Folks,
Can the DATEVALUE function reference a cell address such as A3 rather than be hard coded?
0
Comment
Question by:Frank Freese
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 81

Expert Comment

by:byundt
ID: 39718234
Of course it can.

What data does the cell contain in your workbook that DATEVALUE cannot convert?
0
 

Author Comment

by:Frank Freese
ID: 39718253
Let's say A3:A40 are dates: 11/01/2013 - 11/30/2013
In cell C2 I would like to enter in a date: 11/15/2013
In cells B3:B40 are various product numbers many repeated for some products might have more sales during this time period.
In cell D2 I enter in a product number: K7896
F2 will tell me how many of a product I sold in that day.
I tried to do this in F2:
{=SUM((DATEVALUE(Range("C2"))=$A$3:$A$40)*(Range("D2")=$B$3:$B$40)}

I get a #VALUE error in F2

I know I could use filters but I'm trying to do this with a formula.
0
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39718260
Your problem is with Range("C2"). This is VBA syntax, and does not work in a worksheet formula. The worksheet equivalent is INDIRECT("C2").

What I suggest instead is a regular formula using SUMPRODUCT:
=SUMPRODUCT((C2=$A$3:$A$40)*(D2=$B$3:$B$40))     if C2 is a date formatted like you showed
=SUMPRODUCT((DATEVALUE(C2)=$A$3:$A$40)*(D2=$B$3:$B$40))        if C2 is text
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Comment

by:Frank Freese
ID: 39718781
One question here....would this be an array formula?
0
 
LVL 81

Expert Comment

by:byundt
ID: 39718784
The SUMPRODUCT formula is an array formula that does not need to be array-entered.

If the formula is not working for you, could you please post a sample workbook that demonstrates the problem? It doesn't need more than five rows of data.
0
 

Author Closing Comment

by:Frank Freese
ID: 39718787
I answered my own last question.
Great...two options for one problem.
Thank you very much
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question