Make a Boolean Expression From A List of Rows in Google Sheets

google-list

We all use search forms every day. There’s usually an advanced search form of some sort that allows you to enter a boolean expression. You know Boolean expressions as “This OR That” – an inclusive search that increases results – or “This AND That” – an exclusive search that limits results.

When you need to filter your results, a powerful method is to make a list of companies, individuals, skills – whatever you are using to get more precise answers – and create a Boolean expression to get a better initial set of results from a search engine. Yet when someone gives you a list of 10, 20, 50, or 100 items the idea of making a delimited list of “Item1” OR “Item2” OR “Item3” is more difficult than you’d like to be.

Never fear: Google Sheets to the rescue! This is a perfect example of a task for a Lazy Programmer™ to solve, as it’s much easier to have a spreadsheet count values and rearrange text for you than it is for you to do the work by hand. Let’s take a look.

As an example, I created a utility spreadsheet that takes a range of values, counts those values, and outputs a result string that delivers a boolean expression to paste into your favorite advanced search page. Whether you’d like to create a list of criteria to find your next job, search Twitter more effectively, or simply create a customized search for Google, this expression builder can help.

This spreadsheet has two formulas that do the work for you. The first one joins a range of values into a concatenated string (turns list of Orange and Apple into ‘Orange’ OR ‘Apple’ OR ”):

join

There are five functions in this expression:

  1. JOIN combines an expression of values into a string connecting each item with the string ‘ OR ‘;
  2. INDIRECT tells the spreadsheet to wait until the range expression in the formula from A2 to the last unblank value in column A is completed and we know the number of the last row to select;
  3. TEXT converts a complex expression into a value – in this case a calculation of the number of rows in the column of this spreadsheet minus the number of blank rows in the column of this spreadsheet – so that INDIRECT will take result of this expression and substitute “5”, the last row above that has a value. This results in a range from A2:A5 to feed back to JOIN;
  4. ROWS counts the number of rows in a range – the standard number in a Google Spreadsheet is 1000 – and returns an integer to feed back to the expression inside of TEXT;
  5. COUNTBLANK returns the number of blank rows in a range, so that our calculation of rows minus the number of blank rows leaves us with the number of rows containing values (4) or the total number of rows including the header (5).

Now that we have our formula, it creates the string:

'Orange' OR 'Apple' OR 'Banana' OR 'Grapefruit' OR ''

From the rows of Orange, Apple, Banana, Grapefruit above. And there is one problem here: that we need to remove the trailing “OR ”” that resulted from the expression.

Our second formula, REGEXREPLACE, removes the last “OR ”” from the string. RegEx is sort of like Black Magic, so you will probably need to use a helper site like Rubular. This string looks for a specific string right before the end of the line (represented by $)

OR ''

and replaces it with nothing.

regex

This leaves you with the strong you want to paste into a search form:

'Orange' OR 'Apple' OR 'Banana' OR 'Grapefruit'

You’re all set! Now, use this utility with any number of rows in your list of items to create a Boolean expression made for you automagically.

Ideas are a Dime a Dozen


I know: ideas are a dime a dozen (or perhaps cheaper with inflation these days). Yet the process of creating, nurturing, and executing on ideas is one of the most critical tasks we do. Getting ideas from start to finish (from inspiration to the point of execution) faster means that you can choose from more of them and learn faster. This is a simple list to help you start this process to create ideas and then decide which ones to act on.

You might use this process to decide on a new startup or product idea, to imagine what your ideal customer might want, or simply to rank a list of initiatives you’d like to try when resources are not infinite (that is to say, you should be doing this all the time 😉

Getting started: get inspired

Getting inspired might be the hardest part to getting started with a project. There are a million and one tasks that get in your way and it’s hard to focus on the task at hand and give it the mental space it deserves.

How do you gain a sense of wonder? Start with the things that matter to you. It could be as simple as recognizing themes in what you do every day. It could be a place you love to go or an activity you engage in. Or it could be a nagging sense that you keep running into the same problem over and over.

Then draw your solutions on a clean sheet of paper. If you prefer to use a whiteboard, that’s cool too – just take a picture of each when you’re done. Just do this in a non-electronic format: doodling or drawing opens up important creative areas of your brain.

Generate Solutions

Great! Now that you’ve thought of an area where you’d like to generate ideas, make a huge list. The longer, the better. If it helps pick a ridiculous number of ideas, like 100. Creating the ideas is more important than filtering them or thinking about why they will or won’t work.

If you think of the ideal person who would benefit from this idea and why they would use it, that’s great! And if that person doesn’t come to mind, write the idea down anyway.

Capture The Ideas

Now, arrange these ideas into a format that makes sense for another person. A good format might be a spreadsheet where you list:

  • A short summary of the idea
  • A type of benefit (e.g. save time, organize information, gain fitness)
  • A tangible goal – this should be an expression of the benefit, e.g. “Never forget to pick the kids up from an activity again”
  • A substitute – if the person didn’t use this idea, what would they use to get this done now? (The answer might be “nothing” or “duh. This is obvious”)
  • How frequently does the person do this activity?
  • Do they spend any money on this task now?
  • A ranking of 1 (Love It!), 2 (ok), or 3 (this idea is on the list but I don’t like it right now)

Note: use a list to organize your thinking 

Capturing the ideas is mostly an exercise to help you make a first cut and see if the ideas you generated previously resonate with you. Keeping them on the list even if they are sort of lame is important to remind you of your prior thinking.

Now, Sift the Ideas and Rank

There is a sad truth: you cannot complete all of your ideas in the time you have available. What you should do at this point is pick the best ones and start the process of really working on them to see whether they are good enough in the real world to pursue.

First, check the ideas that you said were really awesome and pick the top 5 or 10. If you only have a few top ideas or if you have a lot, find the one you like least in this group and move it to a “2 – ok”. Now take one of the ideas in the OK group and figure out a way to love that idea and move it up to “1- love it!”

Get Stuff Done

Now, go act on one of the best ideas. Get something done, go and do work for a limited amount of time, and then come back to your idea list. Knowing how long you’ll need to try to get results really depends upon the tangible goal.

Your interim goal might be conversation-based and should be quantified, like talk to 20 customers and get feedback using a 6 question survey that I need to design. And to get to that goal you might have to identify a larger input goal, like contact enough customers to generate 20 conversations in 7 days.

When you generate results from testing your initial ideas, you’ll have better feedback to evaluate whether they are immediate successes or need additional feedback. And that process of iterating through your ideas will also inform your opinion on whether this is a “good idea” or whether it should be stacked lower on your idea list.

Generating, refining, and testing your ideas is a practice and a skill. Improving your idea process is critical to being a better decision-maker – and fun too!

We Need to Teach Digital Citizenship

(photo "IACP austin 2011: cooking with UT elementary kids at whole foods" by Sarah Gilbert)
(photo “IACP austin 2011: cooking with UT elementary kids at whole foods” by Sarah Gilbert)

How can we establish a local and national effort to better prepare young people to participate online? They need to learn how to identify and use tools; understand and model behavior that won’t embarrass their parents or themselves unless they want to do so; and connect with others and contribute in a positive way online and offline.

“I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.” -Abraham Maslow

It’s easy to get attached to the first tool you pick up. It’s also easy to use that tool in situations where it doesn’t function as well. We need to teach young people that when engaging with other people, there are many ways to influence others. You can use your writing and snappy wit to shine on social media. You can wow a friend with a heartfelt thank you note. And you can impress a colleague by putting your phone away, making eye contact and having a great conversation. Digital citizens know when to use the right online and offline tools to make a great impression.

Would you like your words repeated by others?

The best tools are not very useful when you use them poorly. We need to persuade and teach our digital citizens to understand and model the right behaviors online. Keep in mind that this doesn’t mean encouraging them to be robotic or boring or perfect. It means helping them to understand the impact of their behavior so that they won’t embarrass their parents and themselves (unless they want to).

How would you behave if internet actions were more like being at a dinner party?

We also need to encourage our digital citizens to meet online and engage offline. Connecting with others is much more powerful in person and turns your interactions into meaningful lifelong relationships. You can connect with more than 150 people online, and you can’t really know them unless you talk to them, meet them face to favs, and connect to them on a human level.

Where do we go from here?

Becoming a digital citizen doesn’t mean giving up the tools and joys and horrors of social media. It means engaging with the world as a person and not as a persona. It means taking the time to go visit a friend instead of just clicking “like”. And it means making the effort to be fully engaged as a human with your surroundings while understanding the worldwide reach instant publishing can grant to spread your words and thoughts around the world in an instant.

Please contribute to the discussion by adding your thoughts below – what is the one thing you would teach a teenager about interacting on the Internet and understanding your impact on people?

Why I wish Jelly were more like whiteboarding

Jelly Collage, (photo by Mashable)
Jelly Collage, (photo by Mashable)

You may have heard of the new app Jelly – it’s a simple idea, really – that people would rather share questions with each other through pictures and then use those pictures to elicit discussion. Find answer to important things, the pictures say, and help your friends solve their problems and answer their difficult questions. (Or perhaps their more juvenile ones. But I digress).

I think the folks at Jelly are on to something interesting, and I wish they had extended their idea to include the kind of sustained noodling one does at a whiteboard. Let it be said that I love whiteboarding. There is maybe nothing more interesting than standing up at a whiteboard and working through the confines of an idea visually, perhaps drawing and redrawing an idea until it becomes reality. When you’re done with a whiteboard session you can literally see the ideas falling off of the wall, made whole by a process of drawing, erasing, and ideating. So I wish Jelly worked more like a whiteboard.

What do I mean when I suggest that a question interaction be more fluid? For starters, I love the ability that Jelly promotes to draw on a photo using a stylus. This is nifty and allows for a lot of creativity. It’s also really hard to draw with your fingertips on a phone screen with any kind of fidelity. What if you could pinch zoom the photo and start drawing in a higher fidelity. What if you could string some of these Jelly “tiles” together into a kind of mosaic? And what if you could lead people in a “choose your own adventure”-style conversation through multiple tiles? You can start doing some of this today, but there isn’t really a narrative yet in a single question and answer format.

It’s clear that the folks behind Jelly didn’t make the medium for storytelling, or really for serious conversation (yet). The idea of long-form storytelling, or even the art of asking a good question that requires some exposition to solve, demands a bit more resolution. What if there were a place to share bigger images that acted more like a whiteboard and gave people the opportunity to make mini-canvases. I’d certainly like to see the whiteboarded solutions to many problems in the style and colors people would use if they were having an animated conversation and interaction in the same room.

Yes, you say, there’s no real need for this – we’ve got web conferencing, and we all know how engaging that can be sometimes (ew). But I think there’s something more here. Jelly points at a need for human storytelling, and I think that the combination of this idea with a tablet, smartboard, or another kind of stylus will soon make it easier to collaborate on remote whiteboard drawings at the same time and not have it feel laggy or dumb. At the end of the day it’s just drawing pictures.

Turn Off Your Lizard Brain

Seth Godin - "Quieting the Lizard Brain"
Seth Godin – “Quieting the Lizard Brain”

Seth Godin

“You don’t need to be more creative – you need a quieter lizard brain” –Seth Godin

Your brain is not your friend. At any moment now you might encounter something scary or unexpected or just plain wacky that will inspire your lower brain functions to conduct a simultaneous takeover of your higher functions (it’s for your own good, your brain tells you before quickly pulling out the rug.)

The hijack of your brain does happen to all of us. Emotional stimuli cause you to protect the most important things, not to think critically about the next step you need to take toward your goal. If you resist this effect or at least learn to recognize when it’s happening, you’ll spend more of your time (as Seth Godin suggests in the video above) getting ideas out the door in the form of product.

The first product that you build is probably not your best. And without this counterpoint to improve you won’t get to the best product waiting two, three, or twenty iterations down the road. So listen to Godin when he points out that getting a product out the door is what matters. Note that Godin doesn’t say “ship any product.” He sells you on shipping the best combination of product and utility available using the time and money that you have.

How can you make that choice today? Do a little bit every day. Make a commitment to deliver something with an impossible (or at least uncomfortable) timeline and then go deliver something good enough to meet that requirement. Because good enough is the first step on the highway to great. You won’t get there overnight, and you can’t get there if you don’t start walking.

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: