formula to control font size with number of carriage returns/lines

I know I can change font size of a field with a formula in the format text area based on length of string, but is there a way to change font size based on how many lines/carriage returns the memo field contains?

For example:
If memo field contains 3 carriage returns, then font size 10
If memo field contains 4 carriage returns, then font size 9
If memo field contains 4 carriage returns, then font size 8

I have this field in a report, but I have limited vertical space to fit it and the field can vary from 2 lines up to 8 lines, so I need to shrink the text so it always fits in the same space of the textbox that the field is nested in.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Are the CR part of the text or are you looking at a text field that is wrapping?

IO_DorkAuthor Commented:
its technically a "memo" field of my database table.

example of data in the memo field:

ABC Company
11148 Main St.
Anytown, US 99999
Acct.#YYYYYYYYYY (Checking)
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
You can find out how many logical lines (how many line feeds + 1) are in the database column by doing something like:
UBound(Split({your_Field}, CHR(10)))

If you need a more precise way to fit text into a given space, there's a UFL that automatically sets a given text font to fit it into given dimensions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
If you call the formula Ido provided CR_Count, you can use something like the below in the format formula for font size

If {@CR_Count} = 1 then
Else if {@CR_Count} = 2 then 
Else if {@CR_Count} = 3 then

Open in new window

IO_DorkAuthor Commented:
Thanks, works perfectly!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.