Link to home
Start Free TrialLog in
Avatar of Tom Wallace
Tom WallaceFlag for United States of America

asked on

Sum based off condition

Hi all,


I am trying to create a column that will sum two other columns based off a condition & cannot seem to get it correct. for example heres what the data looks like:


CustomerID      Product   Sales   Sales2

1                          fruit          500

2                          veggi       100        200

3                          veggi       50           200   

4                           fruit         150


the goal is create a column called sales3 that when the product = fruit it will return the Sales column and when the product = veggi it will only return sales2 column.


what is the best way to achieve this?


thank you

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tom Wallace

ASKER

oh wow I didn't think it would be so simple