Dynamically populating cells dependent on the previous cell being not blank

I have 6 columns which all depend on the previous column in order to not be blank.

Criteria:
col1 is never blank
col2 through col6 can only populated if the previous field is not blank, but can also be blank.

an example scenario would be this:

col1 uses regex to populate a value
col2 also uses a regex to pick a value (but can also be blank 2% of the time)
col3 checks if col2 is blank, if not uses regex to pick value, but can be blank 4% of the time.

this continues through col6 and probability of the cell being blank increases with each step.

I’ve tried to use a formula but could not get it to work the right way.
if ('col2').nil? then 'blank' else 'not blank' end

Thanks in advance for your help, and please let me know if you need anymore information!

I’m sorry for not getting back to you sooner. The key is to use inline formulas, which you can define by clicking the f(x) button at the end of each field row.

Here’s an example that does what you need: http://www.mockaroo.com/dbbfc6d0

Notice how the last f(x) button is highlighted blue. If you click it you’ll see the following:

if col1.nil? or col2.nil? then nil else this end

This tells mockaroo to return a blank if either col1 or col2 is blank, otherwise return the generated value.

Oh wow , seems like I just read right past the explanation of this in the f(x) modal. Thanks for the reply, thats something I should have realized much sooner.