Question: I'm really having problems writing a MID formula to extract the due date (always the same length) and Row count (variable length). Could anybody help me please? I'm getting a little lost with nested formulas.

Project in Batch 100 of 120 for A2B\_1414696641872. Due date: **2014-11-03**. Word count: 1976. Row count: **345**.

Strings in column A, column B should contain 2014-11-03 and column C should contain 345

Project in Batch 10 of 12 for A2B\_141469664. Due date: **2014-11-03**. Word count: 19. Row count: **3**.

Strings in column A, column B should contain 2014-11-03 and column C should contain 19

--

I currently have the following for extracting the due date (it works):

```
=MID(LEFT(B1,FIND(". Word count",B1)-1),FIND("Due date:",B1)+10,LEN(B1))

```

Answer: 
A variable assignment is just a singular binding: 

```
[x   for v in l   for x in [v]]

```

This is a more general answer and also closer to what you proposed. 
So for your problem you can write:

```
[x   for v in v_list   for x in [map_to_obj(v)]   if x]

```
A local variable can be set within a comprehension by cheating a bit and using an extra 'for' which "iterates" through a 1-element tuple containing the desired value for the local variable. Here's a solution to the OP's problem using this approach:

```
[o for v in v_list for o in (map_to_obj(v),) if o]

```

Here, `o` is the local variable being set equal to `map_to_obj(v)` for each `v`.

In my tests this is slightly faster than Lying Dog's nested generator expression (and also faster than the OP's double-call to `map_to_obj(v)`, which, surprisingly, can be faster than the nested generator expression if the `map_to_obj` function isn't too slow).