[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sumproduct

Posted on 2011-09-21
5
Medium Priority
?
323 Views
Last Modified: 2012-05-12
See attached spreadsheet.  On the totals sheet, I need the yellow cells to count the number of records on sheet "R" column V.  I can't change the format in column V.  I'm sure there is an easy solution but I can't seem to figure it out.

Below is my attempt to try to solve this.  Can you help?

=SUMPRODUCT(--(TEXT('R'!$V$2:$V$30,"mmmyy")=TEXT(A3,"mmmyy")>0))


Thanks!
test.xls
0
Comment
Question by:dddw
[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
5 Comments
 
LVL 42

Expert Comment

by:dlmille
ID: 36578643
Quick question - are you trying to count number of dates for the month and year, or number of dates (in the other sheet) that match the date in column A (I think the latter, but checking - as your formula converts to MMMYY)...

Dave
0
 
LVL 6

Expert Comment

by:reitzen
ID: 36578660
An array formula can provide you with the solution you are looking for.

If you are not familiar with array functions, you are comparing several things in your range before the formula returns "true".  In this case, you are asking for the month, day, and year to be true before returning "1".  The SUM function adds up all TRUE instances.

When entering an array function, you do not enter the curly brackets.  They are inserted for you when you press CTRL + SHIFT + ENTER after the formula.  So, if you want to copy the formula below, do not include the curly brackets when you highlight the formula.  Paste what you've copied into the cell and press CTRL + SHIFT + ENTER to enter the array formula.
{=SUM((MONTH('R'!$V$2:$V$30)=MONTH(A2))*(DAY('R'!$V$2:$V$30)=DAY(A2))*(YEAR('R'!$V$2:$V$30)=YEAR(A2))*1)}

Open in new window

0
 
LVL 42

Assisted Solution

by:dlmille
dlmille earned 2000 total points
ID: 36578664
For the individual date count, use this formula:

=SUMPRODUCT(--(A2=DATEVALUE('R'!$V$2:$V$30)))


A quick way to see if your comparisons will work, setup an equality on a limited number of datapoints... E.g, in a random cell, type:

  =A2=DATEVALUE('R'!$V$2:$V$30)  

then select the entire formula and hit F9 - that's how I review to see what the result would be.  Then, it was just a case of wrapping a counting function like SUMPRODUCT with -- to count the TRUE's

See attached...

Dave
test.xls
0
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 total points
ID: 36578669
@dddw - of course, you were on the right track, and although I like to use DATEVALUE to get at the day date, independent of time, you could also have used:

=SUMPRODUCT(--(TEXT(A2,"MMDDYY")=TEXT('R'!$V$2:$V$30,"MMDDYY")))

Cheers,

Dave
test-r1.xls
0
 

Author Comment

by:dddw
ID: 36580320
Thank you!  Both of those solutions work great.  I appreciate the information.  
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

656 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