# SUMPRODUCT

#### KII

##### New Member
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????

Regards,

Kev@stmerryn.co.uk

### Excel Facts

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

#### SIXTH SENSE

##### Well-known Member
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
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

##### MrExcel MVP
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

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

Replies
1
Views
998
Replies
3
Views
1K
Replies
9
Views
481
Replies
65
Views
1K
Replies
5
Views
267

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.

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.

### Which adblocker are you using?

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

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