Drag formula and range auto changes

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,577
Office Version
  1. 365
Platform
  1. Windows
Hi all

The following formula populates cell F2

Code:
=SUMIF(Database!$AW$2:$AW$5000,"*November*",Database!L$2:L5000)/($D$5-(COUNTIF(Database!L$2:L$5000,"NA")))

when I drag it down to F3 is there a way that the following parts of the formula (marked in RED will change to next column range

so F3 will hold formula
Code:
=SUMIF(Database!$AW$2:$AW$5000,"*November*",Database[COLOR="#FF0000"]!M$2:M5000[/COLOR])/($D$5-(COUNTIF(Database![COLOR="#FF0000"]M$2:M$5000[/COLOR],"NA")))

then F4 will hold formula
Code:
=SUMIF(Database!$AW$2:$AW$5000,"*November*",Database[COLOR="#FF0000"]!N$2:N5000[/COLOR])/($D$5-(COUNTIF(Database![COLOR="#FF0000"]N$2:N$5000[/COLOR],"NA")))

etc etc

any help appreciated

kind regards
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Re: Drag formula and ragne auto changes

Try replacing Database!L$2:L5000 with INDEX(Database!$L$2:$N$5000,,ROWS($A$1:A1))
 
Upvote 0
Re: Drag formula and ragne auto changes

Like this?

Code:
=SUMIF(Database!$AW$2:$AW$5000,"*November*",INDEX(Database!$L$2:$N$5000,,ROWS($A$1:A1)))/($D$5-(COUNTIF(INDEX(Database!$L$2:$N$5000,,ROWS($A$1:A1)),"NA")))

if so I'm getting a #REF! error
 
Upvote 0
Re: Drag formula and ragne auto changes

Ref? Do you have a sheet called Database? Does that have ref errors in it?
 
Upvote 0
Re: Drag formula and ragne auto changes

maybe using OFFSET might yield the results?

=OFFSET(Database!L3:L5000,0,ROWS($A$1:A2)-1)
 
Upvote 0
Re: Drag formula and ragne auto changes

maybe using OFFSET might yield the results?

=OFFSET(Database!L3:L5000,0,ROWS($A$1:A2)-1)

so...
=SUMIF(Database!$AW$2:$AW$5000,"*November*",OFFSET(Database!L3:L5000,0,ROWS($A$1:A2)-1)))/($D$5-(COUNTIF(OFFSET(Database!L3:L5000,0,ROWS($A$1:A2)-1)),"NA")))
 
Upvote 0

Forum statistics

Threads
1,196,501
Messages
6,015,567
Members
441,902
Latest member
alhaste

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