Lookup across a row and use offset to disregard last cell with data

ogwt

New Member
Joined
Oct 8, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hello

I was helped out is another forum to get an excel formula which would lookup across a row and find the last column/cell with data, then count the number of cells with any data in them, but not including the last column.

The formula goes in Cell A2 and starts to read across the row from Cell F2 thru X2
This adds a "1" in cell A1, where data is present from F2:W2 due to the offset function, or a "zero" where there is not data between F2:W2
This data is dynamic and the number of columns increases daily.

Formula that works perfect in excel is
Excel Formula:
=IF(COUNT(OFFSET(F2,0,0,1,LOOKUP(2,1/(F2:X2>0),COLUMN(2:2))-1))>0,1,0)

But this does not work in Google sheets?
Image attached how it works in excel

Any thoughts?

Thanks in advance.
 

Attachments

  • Screenshot.png
    Screenshot.png
    8.6 KB · Views: 12

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Sorry, made a mistake there,
The part in red is correct now as Cell A2 and Not A1:

"This adds a "1" in cell A2, where data is present from F2:W2 due to the offset function, or a "zero" where there is not data between F2:W2"
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top