Hi, my excel friends!

I need formula for B6 column:

If: A6=-1
Value if true: last value from C column that was longer than 5 digits. (in this case value in B6 is C3, in B8 is C7).
Value if false not necessary

Screenshot_146.jpg