cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sparky564
New Member

Age Count and Colour in PApps

I have created a gallery displaying personal data of employees. I would like two things to happen:

 

1. When the "Age" box is <=20 years old, it turns red.

 

The only code that works for me is:

If(ThisItem.Age = "20", red,white)

 

Obviously this code only captures those aged 20. Replacing the "=" with <= does not work. Any suggestions?

 

2. Count 

 

I want to use the count feature to count how many personnel are under 20. 

I tried CountIf(List,Age <="20") but this did not work. Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

@Sparky564 

If your age value is text type you could try If(Value(ThisItem.Age)>=20, Red, White) and 

CountIf(List, Value(Age) <=20)

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

@Sparky564 

If your age value is text type you could try If(Value(ThisItem.Age)>=20, Red, White) and 

CountIf(List, Value(Age) <=20)

It works! Thank you very much

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,208)