Count number of populated fields among a group of 10 numeric fields.

  • 0
  • 1
  • Question
  • Updated 4 months ago
  • Answered
I have a group of 10 numeric fields, some of them contain data and some don't. I want to count the number of fields which contain data, for example if field 1 contains <3241>, field 2 contains <4567>, field 3 is <empty> resulting total should be 2. I want to make this work in a calculated column so it can be used in reports. 
Photo of Raj Helaiya

Raj Helaiya

  • 1,266 Points 1k badge 2x thumb

Posted 4 months ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,572 Points 20k badge 2x thumb
Count([field1], [field2], [field3])
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
You can use the count function to count "trues".  There is a question as to how to deal with blanks.  if the fields are NOT set to treat blank as zero (ie to treat them as null)

Count(
not IsNull([Field 1]),
not IsNull([Field 2]),
...
not IsNull([Field 10]))

If they are set to treat blank as zero then

Count(
[Field 1]<>0,
[Field 2]<>0,
...
[Field 10]<>0)
Photo of Raj Helaiya

Raj Helaiya

  • 1,266 Points 1k badge 2x thumb
Thanks this worked just fine!