ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Array Formula (https://www.excelbanter.com/excel-discussion-misc-queries/147566-array-formula.html)

Martina[_2_]

Array Formula
 
Hello, I am working on an assignment and have problems with getting
the result I need using array formula. I have three columns: Vehicle
Type (e.g. Car, Moped) - data in E5:E104; Vehicle Colour (e.g. Blue,
Silver) - data in F5:F104; Residence (e.g. W1, EC4) - data in G5:G104.
I want to create a formula to see how many Blue Cars were registered
in W1? The formula I use is: =COUNT(IF($E$5:$E$104="Car",IF($F$5:$F
$104="Blue",IF($G$5:$G$104="W1")))) and then to make it into an array
formula press ctrl+shift and hit enter. Can anyone explain why I am
not getting anything, it says error? Thanks!


JB

Array Formula
 
Heelo,

=SUMPRODUCT((E5:E104="car")*(F5:F104="blue")*(G5:G 104="w1"))

JB

On 22 juin, 13:01, Martina wrote:
Hello, I am working on an assignment and have problems with getting
the result I need using array formula. I have three columns: Vehicle
Type (e.g. Car, Moped) - data in E5:E104; Vehicle Colour (e.g. Blue,
Silver) - data in F5:F104; Residence (e.g. W1, EC4) - data in G5:G104.
I want to create a formula to see how many Blue Cars were registered
in W1? The formula I use is: =COUNT(IF($E$5:$E$104="Car",IF($F$5:$F
$104="Blue",IF($G$5:$G$104="W1")))) and then to make it into an array
formula press ctrl+shift and hit enter. Can anyone explain why I am
not getting anything, it says error? Thanks!




Martina[_2_]

Array Formula
 
Thanks JB! I guess I was trying to use the wrong formula :-)



Pete_UK

Array Formula
 
You can only use COUNTIF (and SUMIF) if you have a single criteria.
Where you have more than one criteria you need to use SUMPRODUCT or an
array formula along the lines of

=SUM(IF((condition_1)*(condition_2)*(condition_3), ... , ...))

Hope this helps.

Pete

On Jun 22, 12:55 pm, Martina wrote:
Thanks JB! I guess I was trying to use the wrong formula :-)





All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com