Skip to main content

I am trying to automatically count the number of specific items in a drawing.  A simplified Ex...  I have house plan with 4 speakers and 3 TV's.  The speaker and TV symbols are template items that are dragged into a floor plan.  I would like to have a chart at the top that would show the sum total of these items.  Is there an automatic calculation that would look at all objects in the drawing and if an object has a data attribute that says "Camera" or "TV" then add 1 to the total of camera or TV in the chart.  


Is this possible?

Hi @kevin b103 thanks for posting in the community! I would recommend using Formulas to achieve this- specifically the 'COUNT' function. Please read through this article from the Lucidchart Help Center and our Lucid Formulas documentation for some information on this.


Feel free to let me know if you have any questions. Hope this helps!


Hmm  I am still running into some problems. I am not seeing how to reference the shapes in a diagram.  


Here is a screen shot of a shape where I have setup a custom data field called "Type" with the "Camera" as the variable.  


I am trying to find the nomenclature to give feedback that shows the number of objects that has "Camera" in the "Type" field.  


=count(DESCENDANTS(PAGE)"Type") or 


=COUNT(@Type."Camera")


or...????


Hi Kevin you've got a great start - the correct formula is a combination of the two you drafted about! Try:


=COUNTIF(DESCENDANTS(page) @'Type' = 'Camera')


COUNTIF will tally elements that meet a specific condition DESCENDANTS(page) references the shapes that contain the property you want to count then the criteria following @ are the requirements the shapes need to meet in order to be counted. 


Give this a try and let me know if you have any additional questions!


YES!!  That does it.  Thank you for the direction on this!!


I'm glad to hear it Kevin! Let me know if you have more questions. 


Reply