Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Several if conditions in a formula

I want to use several if-selections in 1 formula.

E.g.

Country, Customer, CustomerOrders

Netherlands, A, 5

Netherlands, B, 7

Netherlands, C, 8

Belgium, N, 8

Belgium, O, 5

Belgium, P, 6

Germany, A, 7

Germany, R, 7

Germany, S, 9

The goal is to count all CustomerOrders for the Netherlands for Customers A + B, and for Belgium for Customers O + P, and for Germany for the Customers R + S

I have a begin:
Count(if(Country = Netherlands and (Customer = A or Customer = B), CustomerOrders))...but then I get stuck.

Can somebody help me with this formula?

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You can use like this

    = if(Country = Netherlands,Count({<Country={'Netherlands'},Customer={'A','B'}>} CustomerOrders),if(Country = Belgium ,Count({<Country={'Belgium'},Customer={'O','P'}>} CustomerOrders),if(Country = Germany,Count({<Country={'Germany'},Customer={'R','S'}>} CustomerOrders))

)

)

Celambarasan

View solution in original post

3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You can use like this

    = if(Country = Netherlands,Count({<Country={'Netherlands'},Customer={'A','B'}>} CustomerOrders),if(Country = Belgium ,Count({<Country={'Belgium'},Customer={'O','P'}>} CustomerOrders),if(Country = Germany,Count({<Country={'Germany'},Customer={'R','S'}>} CustomerOrders))

)

)

Celambarasan

jagan
Luminary Alumni
Luminary Alumni

Hi,

Without using If Statement you can simply use the following expression

=Count({<Country={'Netherlands'},Customer={'A','B'}>} CustomerOrders) +

Count({<Country={'Belgium'},Customer={'O','P'}>} CustomerOrders) +

Count({<Country={'Germany'},Customer={'R','S'}>} CustomerOrders)

Regards,

Jagan.

Not applicable
Author

Thanx Celambarasan, the function you added helped me! It is solved now!