SUMPRODUCT

KII

New Member
Joined
Oct 27, 2002
Messages
33
OK.

I have a sheet which holds a hardware inventory. In the sheet is a colunm which has the ship date of each peace of hardware. There is also a colunm which denotes what type it is (eg Server,Desktop or Laptop).

I need to create a formula that goes through the rows and counts all server, Desktops and Laptops and tell me the following:

servers older than 3 years
desktops older than 5 years
laptops older than 3 years


Can this be done using SUMPRODUCT or COUNTIF????

Please Help.

Regards,

Kev@stmerryn.co.uk
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

SIXTH SENSE

Well-known Member
Joined
Oct 29, 2003
Messages
1,883
hi!
if you just need to count all server,laptop, etc. then countif is applicable. but if you want to know the item that is more than N years from shipment then sumproduct is mostlikely the answer.
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Like this?
Book1
ABCDEFGHI
1ItemnoTypeShipdateTypeYearsoldCount
21server30-jan-03server33
32desktop02-jan-00desktop50
43laptop03-jan-00laptop34
54server04-jan-00
65desktop05-jan-00
76laptop06-jan-00
87server07-jan-00
98desktop08-jan-00
109laptop09-jan-00
1110server10-jan-00
1211desktop11-jan-00
1312laptop12-jan-00
Sheet2
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
fairwinds said:
Like this?

=SUMPRODUCT(($B$2:$B$13=F2)*($C$2:$C$13<=DATE(YEAR(NOW())-G2,MONTH(NOW()),DAY(NOW()))))

Bit shorter:

=SUMPRODUCT(--($B$2:$B$13=F2),--(DATEDIF($C$2:$C$13,TODAY(),"Y")>G2))
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Completely forgot about DATEDIF :oops:

I wonder why they keep such a useful function "hidden".
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,885
Messages
5,766,936
Members
425,388
Latest member
Cave_Johnson

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
Top