13 Replies Latest reply on Dec 12, 2017 2:48 AM by Karim ZAKI

# CONDITION IF

Hi Everybody,

I'm looking to calculate a SUM of values available in a column IF an other column contains "YES" OR MAYBE". I tried this :

IF [Résultat CSPE 2017] = "YES" OR  [Résultat CSPE 2017] = "MAYBE"  THEN ([Valeur CSPE])END

But this does not count work.

Thank you very much in advance.

• ###### 1. Re: CONDITION IF

What error you are getting ? Sample data ?

• ###### 2. Re: CONDITION IF

It does not calculate. It gives me 0 as a result.

When i put : IF [Résultat CSPE 2017] = "YES"   THEN ([Valeur CSPE])END

IT works perfectly but when i add the "maybe" condition it gives me 0

• ###### 3. Re: CONDITION IF

Try this -- >IF max([Résultat CSPE 2017]) = "YES" OR  max([Résultat CSPE 2017]) = "MAYBE"  THEN sum([Valeur CSPE])END

• ###### 4. Re: CONDITION IF

OK Can you share sample datasource ? Even one line is enough ?

• ###### 5. Re: CONDITION IF

It does not work. It does not count the maybe lines ... below fake data juste to  be more clear.

• ###### 6. Re: CONDITION IF

What type of data are you connecting to? Some are case-sensitive, could be you just need to match case in your statement. When I try your statement with the data, it works just fine, so this seems the next most likely culprit.

• ###### 7. Re: CONDITION IF

It works fine , please check the case sensitive part since I see All Capitals in your CALCULATIONS but mixed in Sample data.

• ###### 8. Re: CONDITION IF

What i did not tell is that i am writing in french. Which means that "Maybe"="peut-être".

When i write the formula : IF [Résultat CSPE 2017] = "peut-être" OR   THEN ([Valeur CSPE])END it gives me 0 which is false.

In Excel i can calculate this easily

Do you think it is about "peut-être" ?

• ###### 9. Re: CONDITION IF

I get with that also , difficult to tell until you share your workbook

Thanks,

Ritesh

• ###### 10. Re: CONDITION IF

That changes the context of the calculation completely.  What was being discussed to this point was a non-aggregate calculation, by using MAX and SUM it's now turned into an aggregated calculation.

From the sample data provided, I'm guessing the result should be a non-aggregate calculation.

• ###### 11. Re: CONDITION IF

No I am using this only(You are checking my older comment I guess ) --->IF [Resultant CSPE 20171] = "Yes"  OR  [Resultant CSPE 20171] = "peut-être" THEN ([Value CSPE])END

• ###### 12. Re: CONDITION IF

IT does not work. it seems like its does not count the cells "peut-être". What should I share with you to be able to answer me ?

Karim

• ###### 13. Re: CONDITION IF

Hi Mark,

I'm using an Excel file. The column that i use contains "oui" or "non" or "peut-être". When i write the formula, it does not count the "peut-être" cells.

I also to put just : IF [Résultat CSPE 2017]="peut-être" THEN [Valeur CSPE] END but the result is 0