Solved

excel formula

Posted on 2011-03-06
12
476 Views
Last Modified: 2012-05-11

Please can you help; I need to amend the formula held in sheet2 of my workbook ("Stats table") cell reference F6.

The formula current counts B14:B2000 sheet1

I need to amend this formula so that it only counts within a particular date range. The date range will be From/To F3:F4

So only dates which fall between “from” and “to” would be returned in the total count.

For example B17 sheet 1 would be omitted from the total count because the 07/03/2011 falls outside the date range in F3:F4 Sheet 2



Sun1.xls
0
Comment
Question by:Gazza83
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 167 total points
ID: 35048396
Try this formula there

=SUMPRODUCT(('Low Volume'!B14:B20000>='Stats Table'!D3)*('Low Volume'!B14:B200002<='Stats Table'!D4))

Sid
0
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 35048399
Hi there,

Perhaps you could use something like this ...

=SUMPRODUCT((('Low Volume'!$B$14:$B$2000)>=F3)*(('Low Volume'!$B$14:$B$2000)<=F4))

Open in new window


Zack
0
 

Author Comment

by:Gazza83
ID: 35048792
Thanks Guys,

This formula comes back with a  result of 1, when I know the result should equal 3:-

=SUMPRODUCT((('Low Volume'!$B$14:$B$2000)>=F3)*(('Low Volume'!$B$14:$B$2000)<=F4))

I changed the D3 to F3 and D4 to F3 but the result come back as #Name?

=SUMPRODUCT(('Low Volume'!B14:B20000>='Stats Table'!D3)*('Low Volume'!B14:B200002<='Stats Table'!D4))
0
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 35048836
Maybe it's your formatting.  The actual value of F4 (Date To) is 3/6/2011, while it shows a format of Sun 06/03/2011.  I'm assuming you are looking at it wrong.  ??  Your format of F3:F4 is "ddd dd/mm/yyyy", while it should be "ddd mm/dd/yyyy" (without quotes of course).

Zack
0
 
LVL 14

Assisted Solution

by:Zack Barresse
Zack Barresse earned 166 total points
ID: 35048874
And also, FWIW, if you wanted a dynamic range (instead of hard coding your range) you could amend the formula to be...

=SUMPRODUCT((('Low Volume'!$B$14:INDEX('Low Volume'!$B:$B,MATCH(9.9E+307,'Low Volume'!$B:$B),1))>=F3)*(('Low Volume'!$B$14:INDEX('Low Volume'!$B:$B,MATCH(9.9E+307,'Low Volume'!$B:$B),1))<=F4))

Zack
0
 

Author Comment

by:Gazza83
ID: 35048999
double checked the formats so that they are all *dd/mm/yyyy unfortunatly no joy
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35049059
Gazza it is working fine for me. What dates are you putting in and where?

Sid
0
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 35049084
I only see one value which matches the date range, so I'm not sure where you're getting 3 from.  ???

You only have four values on your 'Low Volume' worksheet.  1/3/2011, 1/3/2011, 3/1/2011, 3/7/2011.  For the dates between the date range you specified in F3 and F4 of 'Stats Table' worksheet, 2/1/2011 and 3/6/2011, only one date matches between that range.  Can you explain how it should be 3?

Zack
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 167 total points
ID: 35049132
Hello Gazza,

2 of your dates (the first two in 'Low Volume'!B14:B15) are formatted as text [check by using this formula, =ISNUMBER(B14), you'll get FALSE when it should be TRUE for dates]. If you use this formula where the +0 converts those text-formatted dates to true dates.....

=SUMPRODUCT(('Low Volume'!B14:B20000+0>=F3)*('Low Volume'!B14:B20000+0<=F4))

....then you'll get a result of 3 as required

but I recommend you make those dates consistently dates. Where do they come from? If you select that column and use

Data > text to columns > Finish then that will also convert and you won't need the +0s in the formula.....

regards, barry
0
 

Author Comment

by:Gazza83
ID: 35049192
I've kept the spreadsheet the same, only the formulas result should equal "3" but maybe I'm doing something wrong.
help.JPG
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35049196
Zack,

If the workbook is opened with UK regional settings then (and Gazza is UK based, I assume) then it looks to me as if all the dates in B14:B17 are in March (the first 3 all display the same) so those 3 should all be counted, I believe, but as I say above the first 2 are text-formatted so if you open with US date settings that makes the first 2 look different from the third.....

barry
0
 
LVL 14

Expert Comment

by:Zack Barresse
ID: 35049358
Regional Settings aside, it shouldn't matter.  The function returns what it should.  (And I saw the text on the first sheet, but the formula coerced it, so I wasn't worried about it.)  On the 'Stats Table' worksheet, the format shows different than the value.  I'm thinking this is what is confusing the OP.

Zack
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
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…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now