Function to Count Booleans

There are occasions in a model where I want to count the number of True or False boolean values. Currently the only way to achieve this is to have another line item with an IF THEN function to create a 1 or 0 and then sum the line item. It would be great to have a function to do this automatically.

Tagged:
21
21 votes

New · Last Updated

Comments

  • Status changed to: New
  • Yes, it would also help by reducing model size, since we wouldn't need to add additional line items just to count a Boolean!!

    I hope this concept would get some attention. :)

  • @nick_barker @Stacey_Gibbens @MirBorishkevich @Miran

    I have a solution here:

    Keep the format of the target line item as "Number". Then use the IF Boolean THEN 1 ELSE 0 starting from Opening bracket "(" and ending with closing bracket ")". Use + sign after each boolean. All these booleans can be counted and summed in 1 formula . Check Images for reference:

  • Hi yes that works however it gives you the potential for a horrible IF THEN clause if you are checking lots of Booleans as in your example. In reality counting booleans is normally to allow you to do conditional formatting and I think there are other ideas out there to allow you to just apply a CF directly to a Boolean line item.

  • As long as, there is no other solution anywhere. This works!! This is not a case of nested IF THEN and hence, there is no impact on the performance

Get Started with Idea Exchange


See our Submission Guidelines and Idea Evaluation Criteria, then start posting your own ideas and showing support for others!