# Array Formula Question

**URL:** https://community.glideapps.com/t/array-formula-question/24311
**Category:** Ask for Help
**Created:** [March 15, 2021, 8:30pm UTC](https://community.glideapps.com/t/array-formula-question/24311 "2021-03-15T20:30:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Jen\_NYCP](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jen\_NYCP](https://community.glideapps.com/u/Jen_NYCP)
#### Post date: [March 15, 2021, 8:30pm UTC](https://community.glideapps.com/t/array-formula-question/24311/1 "2021-03-15T20:30:02Z")

</div>

Hi, I am trying to figure out a part of the array formula:

={“SenderName”;ArrayFormula(if(len(D2:D),VLOOKUP(C2:C,{‘Sheet name’!B2:B,‘Sheet Name’!E2:E},2,0),""))}

What does (if(len mean?

Thank you!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 15, 2021, 8:38pm UTC](https://community.glideapps.com/t/array-formula-question/24311/2 "2021-03-15T20:38:09Z")

</div>

That’s just a way of checking if a column in the row is populate. If it is, then go ahead to run the formula. If not then it returns a blank. Otherwise it could put garbage in ever single row and glide would see it and count it against your total row count.

How it works, is if there is something in the D column, then the length is greater than zero and seen as true. If true, it does the vlookup. If false, it write “” (blank) to the cell.

---

<div class="post-metadata">

### Author: ![Jen\_NYCP](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jen\_NYCP](https://community.glideapps.com/u/Jen_NYCP)
#### Post date: [March 15, 2021, 8:41pm UTC](https://community.glideapps.com/t/array-formula-question/24311/3 "2021-03-15T20:41:28Z")

</div>

Ahh gotcha! So if I wanted to make a Receipient Column is would be the opposite?

={“RecipientName”;ArrayFormula(if(len(C2:C),VLOOKUP(D2:D,{‘Sheet Name’!B2:B,‘Sheet Name’!E2:E},2,0),""))}

In these cases… Column C is the sender and Column D is the recipient business row IDs, and I am running this formula to populate the business name in two other columns by looking at the main directory Ex: ‘Sheet Name’.

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 15, 2021, 8:52pm UTC](https://community.glideapps.com/t/array-formula-question/24311/4 "2021-03-15T20:52:55Z")

</div>

Yep, that should work. Whenever I’ve done it, I’ve checked against a column that always had a value in it, such as Row ID. Doesn’t really matter which column you use. It’s just telling it to run the formula on populated rows instead of empty rows.

---

<div class="post-metadata">

### Author: ![Jen\_NYCP](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jen\_NYCP](https://community.glideapps.com/u/Jen_NYCP)
#### Post date: [March 15, 2021, 9:02pm UTC](https://community.glideapps.com/t/array-formula-question/24311/5 "2021-03-15T21:02:44Z")

</div>

Perfect. Thank you! Lastly what does the 2,0 mean at the end?

I know you said the 0 is so it looks for data that is greater than 0 characters aka blank?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 15, 2021, 9:11pm UTC](https://community.glideapps.com/t/array-formula-question/24311/6 "2021-03-15T21:11:55Z")

</div>

Those are the last two parameters of a VLOOKUP formula. Indexed and Sorted.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/4888f5dedc6097178052c603237282983b36bed5.png)

Index is which column in your searched range you want to return. Sorted is just a true or false value to indicate if the data you are searching is sorted or not. It affects what is returned, but if you are searching for an exact match value, then sorted can be false. In this case it’s using ‘0’ to indicate false.

[https://support.google.com/docs/answer/3093318?hl=en](https://support.google.com/docs/answer/3093318?hl=en)

---

<div class="post-metadata">

### Author: ![Jen\_NYCP](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@Jen\_NYCP](https://community.glideapps.com/u/Jen_NYCP)
#### Post date: [March 15, 2021, 9:19pm UTC](https://community.glideapps.com/t/array-formula-question/24311/7 "2021-03-15T21:19:07Z")

</div>

Thanks! I will review this.
