I am trying to sum column P if column B = x and column M <> "Accrual"
=IF(Download!$M:$M<>"Accrual",SUMIF(Download!$B:$B,"x",Download!$P:$P),0)
Where am I going wrong?
If... Sum If
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
If... Sum If
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: If... Sum If
In Excel 2007 and later, you can use the SUMIFS function:
=SUMIFS(Download!$P:$P,Download!$B:$B,"x",Download!$M:$M,"<>Accrual")
In all versions:
=SUMPRODUCT(Download!$P:$P*(Download!$B:$B="x")*(Download!$M:$M<>"Accrual"))
=SUMIFS(Download!$P:$P,Download!$B:$B,"x",Download!$M:$M,"<>Accrual")
In all versions:
=SUMPRODUCT(Download!$P:$P*(Download!$B:$B="x")*(Download!$M:$M<>"Accrual"))
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: If... Sum If
Hans, I get #NUM! (in the SUMPRODUCT version)
Last edited by VegasNath on 27 May 2010, 20:27, edited 1 time in total.
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: If... Sum If
Using the first formula or the second one? (It helps me to help you if you're specific)
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: If... Sum If
What happens if you use limited ranges, e.g.
=SUMPRODUCT(Download!$P1:$P1000*(Download!$B1:$B1000="x")*(Download!$M1:$M1000<>"Accrual"))
=SUMPRODUCT(Download!$P1:$P1000*(Download!$B1:$B1000="x")*(Download!$M1:$M1000<>"Accrual"))
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: If... Sum If
Thanks Hans, got it.
Also, this works, but how can I sum <>"Accrual"
=SUMIF(Download!$M:$M,"Accrual",Download!$P:$P)-SUM(G8:G30)
Also, this works, but how can I sum <>"Accrual"
=SUMIF(Download!$M:$M,"Accrual",Download!$P:$P)-SUM(G8:G30)
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: If... Sum If
That does not work. I need to sum everything where accrual is not in column M. Something like =SUMIF(NOT(..... but I can't get the syntax correct.
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78493
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: If... Sum If
It works in Excel 2007. But try this, in analogy to the earlier formula:
=SUMPRODUCT((Download!$M$1:$M$1000<>"Accrual")*Download!$P$1:$P$1000)-SUM(G8:G30)
=SUMPRODUCT((Download!$M$1:$M$1000<>"Accrual")*Download!$P$1:$P$1000)-SUM(G8:G30)
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: If... Sum If
Sorry Hans, your first attempt was correct, my data was distorted.
Nathan
There's no place like home.....
There's no place like home.....