When I enter the code, it says that there is an error, and I can't do it. I put the code in B1 and the data starts in A1. Copy and pasting in the cell just shows the formula even though the text category is general.

I'm not sure how to post an example workbook, but here is an example of my workbook copy and pasted:

Attention Deficit Disorder in Adults: A Different Way of Thinking by Lynn Weiss, PhD (Taylor Trade Publishing, 2005)
Beyond Anxiety and Phobia: A Step-by-Step Guide to Lifetime Recovery [Paperback] by Edmund J Bourne, PhD (New Harbinger Publications, 2001)
Digging Out: Helping Your Loved One Manage Clutter, Hoarding, and Compulsive Acquiring by Michael Thompkins & Tamara L. Hartl (New Harbinger Publications, 2009)
Dirty Secret: A Daughter Comes Clean About Her Mother's Compulsive Hoarding by Jessie Sholl (Gallery, 2010)
Don't Call Me Nuts: Coping with the Stigma of Mental Illness by Pat Corrigan, Robert Lundin (Recovery Press, 2001)