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

  • Home
  • SEARCH
  • 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 7172521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:37:54+00:00 2026-05-28T15:37:54+00:00

I have a spreadsheet with 2 columns of data, column A and B, and

  • 0

I have a spreadsheet with 2 columns of data, column A and B, and column C where I’m looking for the formula.

row    A      B       C
 1     50
 2   
 3   
 4   
 5            56      6
 6   
 7   
 8     46            10
 9   
 10   
 11           64     18

As you can see, a row either contains a value or not. In column C, I’m looking to calculate the difference between

a) the value in column B and the value in column A’s first non-empty cell directly above (so for example, at row 5, I calculate the difference between B5 and A1 56 – 50 = 6) if the value of B is a number and

b) the value in column A and the value in column B’s first non-empty cell directly above (row 8, 56 – 46 = 10)

and put nothing if neither column A and B are empty.

I’ve been struggling with “first non-empty cell” to write an R1C1 formula. Note that I know I can do this in VBA but I’m looking for the R1C1 formula.

Thanks for your help.

  • 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-05-28T15:37:56+00:00Added an answer on May 28, 2026 at 3:37 pm

    Here is an array formula (that you need to validate with Ctrl + Shift + Enter) you can put in C1 and drag and drop till the end of your data:

    =IF(OR(A1<>"",B1<>""),INDEX($B$1:B1,MAX(IF($B$1:B1="",0,ROW($B$1:B1))))-INDEX($A$1:A1,MAX(IF($A$1:A1="",0,ROW($A$1:A1)))),"")
    

    Or, in a french version of Excel:

    =SI(OU(A1<>"";B1<>"");INDEX($B$1:B1;MAX(SI($B$1:B1="";0;LIGNE($B$1:B1))))-INDEX($A$1:A1;MAX(SI($A$1:A1="";0;LIGNE($A$1:A1))));"")
    

    Note that if you feel interested, you can commit into Stackoverflow in french

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

Sidebar

Related Questions

I have a Excel spreadsheet and I have 3 columns. column A, column B,
I have a google spreadsheet with multiple columns that have variable row counts in
I have an Excel spreadsheet with a table of data in it. The columns
I have a spreadsheet that I am importing that contains some test data for
Let's say I have a spreadsheet that has two columns of data. For example:
I have an Excel spreadsheet of data like: ColumnA ColumnB 33 11 25 5
I have an excel spreadsheet with two columns, one with a list of exercises
I have an Excel spreadsheet with 1 column, 700 rows. I care about every
I have a spreadsheet that I am sorting based on an item number column.
I have an Excel Spreadsheet like this id | data for id | more

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.