Dragging formula along columns with changing reference cells

excel_lisa

New Member
Joined
Apr 17, 2021
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I wrote the following formulas in Cell B2, C2 and D2 of Sheet 2:
B2: =IF(AND(Sheet1!T2<20160000;Sheet1!U2>20150000);Sheet1!V2;"No")
C2: =IF(AND(Sheet1!X2<20160000;Sheet1!Y2>20150000);Sheet1!Z2;"No")
D2: =IF(AND(Sheet1!AB2<20160000;Sheet1!AC2>20150000);Sheet1!AD2;"No")

I want to drag this formula all the way along the next 96 columns.
It should continue as follows:
E2: =IF(AND(Sheet1!AF2<20160000;Sheet1!AG2>20150000);Sheet1!AH2;"No")
F2: =IF(AND(Sheet1!AJ2<20160000;Sheet1!AK2>20150000);Sheet1!AL2;"No")
etc.

However, in reality it continues as follows:
E2: =IF(AND(Sheet1!W2<20160000;Sheet1!X2>20150000);Sheet1!Y2;"No")
F2: =IF(AND(Sheet1!AA2<20160000;Sheet1!AB2>20150000);Sheet1!AC2;"No")
etc.

How can I alter the formula so that it can continue how I want it to?
Thank you in advance!
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

StephenCrump

MrExcel MVP
Joined
Sep 18, 2013
Messages
4,304
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Forum!

Try:

B2: =LET(StartCol;16+4*COLUMNS($B2:B2);IF(AND(INDEX(Sheet1!2:2;StartCol)<20160000;INDEX(Sheet1!2:2;StartCol+1)>20150000);INDEX(Sheet1!2:2;StartCol+2);"No"))
 

excel_lisa

New Member
Joined
Apr 17, 2021
Messages
5
Office Version
  1. 365
Platform
  1. MacOS
Thanks a lot for your reply! Unfortunately the LET function is not recognised by my Excel. Is there a way to do this without the LET function?
 

jasonb75

Well-known Member
Joined
Dec 30, 2008
Messages
13,896
Office Version
  1. 365
Platform
  1. Windows
Using the formula suggested by @StephenCrump without LET,
Excel Formula:
=IF(AND(INDEX(Sheet1!2:2;16+4*COLUMNS($B2:B2))<20160000;INDEX(Sheet1!2:2;17+4*COLUMNS($B2:B2))>20150000);INDEX(Sheet1!2:2;18+4*COLUMNS($B2:B2));"No"))
 
Solution

Forum statistics

Threads
1,144,339
Messages
5,723,801
Members
422,518
Latest member
quack_quack

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
Top