Sum If for named date range

daily106

Board Regular
Joined
Dec 20, 2004
Messages
158
Hi all

I need some help on the following function. dateinformation is named range that include dates. "taskname" and "cost" are also another named range which is the same length as the dateinformation.


What I am trying to do is anything after January of 2011 if the first 16 characters of "taskname" and 16 characters of a1 text matches sum "cost". I am getting #n/a for some reason. Any help would be much appreciated. Thank you.

{=SUM(IF((dateinformation>DATE(2011,1,1))*(LEFT(taskname,16)=LEFT(a1,16),cost,0)}
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi,

I think a parenthesis is missing in your formula
{=SUM(IF((dateinformation>DATE(2011,1,1))*(LEFT(taskname,16)=LEFT(a1,16)),cost,0)}

As an alternative i think you can use
=SUMPRODUCT(--(dateinformation>DATE(2011,1,1)),--(LEFT(taskname,16)=LEFT(a1,16)),cost)


HTH

M.
 
Upvote 0
Thank you very much.

I tried the formular below and now I am getting Value error. I checked the range to make sure they are all correct, but can not see why this is not working.

SUMPRODUCT(--(thrudateinformation>DATE(2010,12,31)),--(LEFT(taskname,13)=LEFT( HD150,13)),project)
 
Upvote 0
Thank you very much.

I tried the formular below and now I am getting Value error. I checked the range to make sure they are all correct, but can not see why this is not working.

SUMPRODUCT(--(thrudateinformation>DATE(2010,12,31)),--(LEFT(taskname,13)=LEFT( HD150,13)),project)
Tell us what the range addresses are for:
  • thrudateinformation
  • taskname
  • project
What's in HD150?

What's in taskname?
 
Upvote 0
Thank you very much.

I tried the formular below and now I am getting Value error. I checked the range to make sure they are all correct, but can not see why this is not working.

SUMPRODUCT(--(thrudateinformation>DATE(2010,12,31)),--(LEFT(taskname,13)=LEFT( HD150,13)),project)

And also tell us what you have in the project range: numbers?
All ranges the same size?

M.
 
Upvote 0
thrudateinformation: $E$1 title
=OFFSET(TimeSheet!$E$1,0,0,COUNTA(TimeSheet!$E:$E),1)

TaskName: $G$1 title
=OFFSET(TimeSheet!$G$1,0,0,COUNTA(TimeSheet!$G:$G),1)

Project: $L$1 title
=OFFSET(TimeSheet!$L$1,0,0,COUNTA(TimeSheet!$L:$L),1)

Thrudateinformation: Date value ex) 8/27/2010
TaskName: text string ex) 1.80.30.15.03.41 ACP020
Project: general number value ex) 121,658
Cell "HD150" has the same text string as "taskname" ex)1.80.30.15.03.45 ACP020

Is it because of the name ranges include the titles?
 
Upvote 0
Do all 3 columns E G and L end at same row?

What do these return
=ROWS(thrudateinformation)
=ROWS(TaskName)
=ROWS(Project)

Are they all the same?
 
Upvote 0
thrudateinformation: $E$1 title
=OFFSET(TimeSheet!$E$1,0,0,COUNTA(TimeSheet!$E:$E),1)

TaskName: $G$1 title
=OFFSET(TimeSheet!$G$1,0,0,COUNTA(TimeSheet!$G:$G),1)

Project: $L$1 title
=OFFSET(TimeSheet!$L$1,0,0,COUNTA(TimeSheet!$L:$L),1)

Thrudateinformation: Date value ex) 8/27/2010
TaskName: text string ex) 1.80.30.15.03.41 ACP020
Project: general number value ex) 121,658
Cell "HD150" has the same text string as "taskname" ex)1.80.30.15.03.45 ACP020

Is it because of the name ranges include the titles?
Are you absolutely certain that ALL the ranges are the same size?

Are there any empty cells in any of the ranges? If there are then that will lead to incorrect range size evaluation.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top