Look for nearest column to the right that contains data

Minglee

New Member
Joined
Jun 1, 2020
Messages
2
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I need to add a formula in Column B that looks for the nearest column containing data to the right of Column B, and then pulls that data into the Column B cells.
For reference: Cell B2 should return the date from C2, Cell B3 should return the data from D3 (as C3 is blank). Is this an Index formula, or ?

1591056499488.png
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Its long winded but this should work - =IF(ISBLANK(C2),IF(ISBLANK(D2),IF(ISBLANK(E2),IF(ISBLANK(F2),IF(ISBLANK(G2),IF(ISBLANK(H2),"Error",H2),G2),F2),E2),D2),C2)
 
Upvote 0
Try:
This is an array formula that must be entered with CTRL-SHIFT-ENTER.

Book1
ABCDEFG
1
255101525
3222268
412122814
Sheet4
Cell Formulas
RangeFormula
B2:B4B2=INDEX($C2:$M2,MATCH(FALSE,ISBLANK(C2:M2),0))
 
Upvote 0
You're welcome. Thanks for the feedback and welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,565
Members
449,237
Latest member
Chase S

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