# 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

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

#### 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
2
Views
832
Replies
2
Views
346
Replies
13
Views
2K
Replies
3
Views
171
Replies
0
Views
1K

1,186,366
Messages
5,957,448
Members
438,306
Latest member
Crystal_Blue

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