Child Parent Formula Help

Options
✭✭✭✭✭
edited 02/19/24

I want my formula to look at the child count column and if it is great than one to run a sum of the children rows and if it has 0 children to run a lookup SUMIFS formula:

I was hoping it would work like this but I keep getting errors.

=IF([Children Count]@row > 0, SUM(Children()), SUMIFS({Curo.Points}, {Curo.Category}, "GENERATING DENIAL LETTER", {Curo.User ID}, LEFT([User ID]@row, FIND("-", [User ID]@row) - 1), {Curo.Week#}, [Week Number]@row) + SUMIFS({CCA.Total}, {CCA.Category}, "GENERATING DENIAL LETTER", {CCA.User ID}, RIGHT([User ID]@row, LEN([User ID]@row) - FIND("-", [User ID]@row)), {CCA.Week#}, [Week Number]@row)

For some reason when I use this formula it's acting like the row is 0 even though its 14 and skipping to the false part of the IF statement.

Any guesses

Tags:

Answers

• ✭✭✭✭✭✭
Options

What is the formula in the [Children Count] column?

• ✭✭✭✭✭
Options

=COUNT(CHILDREN())

Column Forumla

• ✭✭✭✭✭✭
edited 02/21/24
Options

It's hard to say without seeing all your references, but I think using the VALUE() function will solve your problem here as your "User ID" looks to be numeric, and that's your criterion. When you use the LEFT() and RIGHT() functions, they return a text value, even if the text appears to be a number, and you can't match a number 100 to a text of '100. You can test this by adding a number to a LEFT() or RIGHT() value and see if it concatenates the values or sums them:

So I believe you should be able to update your formula to wrap the LEFT() and RIGHT() criterions in a VALUE() function, you should be good to go.

Jason Tarpinian - Sevan Technology

Smartsheet Aligned Partner

• ✭✭✭✭✭✭
Options

You say it is jumping to the SUMIFS instead of doing the SUM(CHILDREN()). What is it actually outputting?

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!