# how to use sumif with filtering

#### jazztech

##### Board Regular
Dear All,

I have a sumif function in a cell which adds values from a table from another sheet. When I apply a filter in the table, the sumif still includes the invisible rows. Is there a simple way to add only the visible rows with a function based on a criteria like with the sumif. i.e. after certain rows are not visible, still a further slection has to be made base don another cell in the same row.

Jazztech

### Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

#### venkat1926

##### Well-known Member
use
specialcells(xlcelltypevisible)

#### mfexcel

##### Well-known Member
You may consider SUBTOTAL
By applying different filters, it essentially means SUMIF(s)...
Take a look at this and see if it helps:
SUM vs. SUBTOTAL | wmfexcel

Dear All,

I have a sumif function in a cell which adds values from a table from another sheet. When I apply a filter in the table, the sumif still includes the invisible rows. Is there a simple way to add only the visible rows with a function based on a criteria like with the sumif. i.e. after certain rows are not visible, still a further slection has to be made base don another cell in the same row.

Jazztech

#### draagreajk

##### New Member
Hi
Im using =SUMIF(K42:K60,"Mark F",H42:H60) or =SUMPRODUCT(--(K42:K60="Mark F"),H42:H60) to work how many hours Mark F works in a day per duration the K42:K60 is the name column and the H42:H60 is the duration. I need to know what formula i need to be able to use with a filter. Currently when filtering the total stays the same regardless of what i do. Please help

Replies
7
Views
99
Replies
1
Views
518
Replies
5
Views
147
Replies
5
Views
22
Replies
2
Views
83

1,129,472
Messages
5,636,516
Members
416,920
Latest member
Riskyplan

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