Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8609879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:59:08+00:00 2026-06-12T03:59:08+00:00

I am trying to come up with a formula that can be run in

  • 0

I am trying to come up with a formula that can be run in a different worksheet and references the data below.

Essentially for each cell in D, I want to check upwards and when I find the string “Invoice” I select the next row above and column B. Essentially I’d be finding the company name each time. As you can see, the number of rows of records for each company may vary.

More simply, the formula could just work on column B and return the string directly above the first occurrence of the string “Status”.

I dislike how complicated this is, but I have no control over the data format I am receiving and the source refuses to change it.

Original Data

    A               B               C               D
1                   ABC Widgets, Inc.
2   Account         Status          Date            Invoice
3   1423            Open            4/25/2011       123748
4   1423            Closed          5/1/2011        432741
5   1423            Open            5/2/2011        522211
6 
7                   XYZ Sprockets, Inc.
8   Account         Status          Date            Invoice
9   3222            Open            5/3/2011        529999
10

Finished Data

    A               B               C               D            E
2   Account         Status          Date            Invoice      Client
3   1423            Open            4/25/2011       123748       ABC Widgets, Inc.
4   1423            Closed          5/1/2011        432741       ABC Widgets, Inc.
5   1423            Open            5/2/2011        522211       ABC Widgets, Inc.
9   3222            Open            5/3/2011        529999       XYZ Sprockets, Inc.

Nutch,

While I can’t get your VBA code to work properly (see comments) it did allow me to come up with this code that finds the first occurrence of “Status” and then offsets 1 cell above. This is essentially what I am trying for but in Formula format.

Sub findFirstStringAbove()
'
Cells.Find(What:="Status", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
    :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase _
    :=False).Offset(-1, 0).Select
End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:59:09+00:00Added an answer on June 12, 2026 at 3:59 am

    Try this formula, entered as an array formula, i.e. with Ctrl+Shift+Enter, then copied down.

    =INDEX(B:B,IF(ROW()>COUNTIF(B:B,"Status"),"",SMALL(IF($B:$B="Status",ROW($B:$B),2000000000),ROW()))-1)
    

    To run it from another sheet, cut and paste it from your original sheet and it will adjust the reference automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to come up with a way combine two arrays that have different
I'm trying to come up with an algorithm that will do the following: If
I'm trying to come up with a good naming convention for boolean variables that
I am trying to come up with a Reg Ex that finds the numbers
I'm trying to come up with an answer to two questions that didn't seem
I'm trying to come up with the largest possible group of friends that would
I'm trying to come up with a table that displays the total number of
I'm trying to come up with a regex that will match anything that is
Currently trying to come up with a best practice for a ZF site that
I am trying to come up with a simple regex that will look for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.