Sep 11 2023 10:56 PM
Hi,
I'm not sure if this is a duplicate query but I am unable to find posts regarding this. I am creating a SharePoint list and the file I am getting the required info from contained IF and COUNTIF to score a field depending on the subfields under it.
The formula used in excel was =IF(COUNTIF(C24:C36,"No"),"No","Yes") for the Details field.
Per the screenshot below, if one of the subfields (Account, Contact, etc) get a No, then the whole Details field will be marked as No getting an actual score of 0 out of the possible 2.
What is the best way I can execute this on the SharePoint list? I tried COUNTA but it doesn't seem to be working the way I want it (or I may be doing it incorrectly )
Thank you in advance for any assistance
Sep 11 2023 11:21 PM
SolutionIn SharePoint Online, you can achieve similar functionality to Excel's COUNTIF with calculated columns and SharePoint column formulas. Unfortunately, SharePoint does not provide a direct COUNTIF function like Excel, but you can work around it using other column types and formulas.
For your specific scenario, where you want to check if any of the subfields contain "No" and then determine the value for the "Details" field accordingly, you can use a combination of calculated columns and column formulas. Here is a step-by-step guide on how to do this:
=IF(OR([Account]="No",[Contact]="No",[OtherField]="No",...),"No","Yes")
Replace [Account], [Contact], [OtherField], etc., with the actual column names for your subfields. You should include all the subfields you want to check in the OR statement.
This approach will calculate the "DetailsCalc" column for each item based on the values in the subfields. If any of the subfields contain "No," it will set "DetailsCalc" to "No"; otherwise, it will be set to "Yes."
Please note that this method relies on calculated columns, and the formula is evaluated when an item is created or updated. If you need real-time calculations based on changes to the subfields, you might need to consider using SharePoint Designer workflows or Power Automate flows to automate the process further.The text and steps were edited with the help of AI.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark them as helpful and like it!
This will help all forum participants.
Sep 12 2023 12:46 AM
@NikolinoDE The IF and OR worked liked a charm, thank you so much! I just did another calculated column to have the numerical value from the DetailsCalc column using IF to get the actual points for Details.
Appreciate the fast response, thanks again!
Sep 12 2023 01:39 PM
Hi, what would be the equivalent solution for counting the amount of times a specific value (a word) appears in a row? This case seems to be number based.