---
title: "BEFORELAST"
description: "BEFORELAST"
keywords: "BEFORELAST"
url: "https://myrapidi.com/wiki/beforelast"
locale: "en"
published: "2009-05-18T07:43:43Z"
modified: "2025-01-13T11:14:33Z"
---

# BeforeLast(data,substring)

The `##BEFORELAST` formula refers to a function designed to extract or manipulate a portion of a string based on the position of a specific delimiter, focusing on everything **before the last occurrence** of that delimiter.&nbsp;

**Example:**

```
##BEFORELAST('Here we are', ' ')  will return 'Here we'
```

**Example:**  
  
**The field name consists of ' Samuel Worobel'.&nbsp;**

```
##BEFORELAST("Name",' ')
```

It will extract the **first name ( Samuel)**&nbsp;from a full name where the last name is separated by a space. If there were multiple spaces, only the text up to the last space would be returned.

&nbsp;Then, if you only need to retrieve the last name, you can use the function[Last()](https://wiki.myrapidi.com/wiki/last).
