Calculating Row reference within Cell Reference

PahiatuaBob

New Member
Joined
Apr 9, 2011
Messages
3
Within Excel, I need a way to calculate the row reference part of a Cell reference within the VLOOKUP Function...
What I am trying to do is return the second column, every 7th row within a range of cells. For example, in a list of daily weight measurements, I am trying to extract into another list the weight for every monday....
I am using VLOOKUP which is returning the correct data, but 7 times until it gets to the next Monday and returns that Monday's data 7 times, and so on. By reducing the size of the range of cells queried (by virtually removing the previous 7 rows each time) I can get the following formula to work, but I have to manually edit the row reference (eg $7) in the formula in each instance.
=VLOOKUP(3,$A$7:$D$628,2,FALSE)
I would like to be able to replace the $7, $14, $21, etc with (7*(ROW()-2)) somehow. This calculation provides the right number for the Row reference, but I don't know how to get it to work WITHIN the cell reference part of the VLOOKUP function.
Does anyone have any ideas please?
Thanks in advance for your assistance
Bob
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Within Excel, I need a way to calculate the row reference part of a Cell reference within the VLOOKUP Function...
What I am trying to do is return the second column, every 7th row within a range of cells. For example, in a list of daily weight measurements, I am trying to extract into another list the weight for every monday....
I am using VLOOKUP which is returning the correct data, but 7 times until it gets to the next Monday and returns that Monday's data 7 times, and so on. By reducing the size of the range of cells queried (by virtually removing the previous 7 rows each time) I can get the following formula to work, but I have to manually edit the row reference (eg $7) in the formula in each instance.
=VLOOKUP(3,$A$7:$D$628,2,FALSE)
I would like to be able to replace the $7, $14, $21, etc with (7*(ROW()-2)) somehow. This calculation provides the right number for the Row reference, but I don't know how to get it to work WITHIN the cell reference part of the VLOOKUP function.
Does anyone have any ideas please?
Thanks in advance for your assistance
Bob
If you have a column of dates then all you need to do is look for the Monday dates.

Let's assume this is your data:

Book1
ABC
11/3/2011MonData1
21/4/2011TueData2
31/5/2011WedData3
41/10/2011MonData4
51/11/2011TueData5
61/12/2011WedData6
71/17/2011MonData7
81/18/2011TueData8
91/19/2011WedData9
101/24/2011MonData10
111/25/2011TueData11
121/26/2011WedData12
Sheet1

You want to extract all the items from column C that correspond to Monday dates in column A.

In the formulas I use the following named ranges:
  • Data
  • Refers to: =$C:$C
  • Dates
  • Refers to: =$A$1:$A$12
Enter this formula in E1. This will return the count of Monday dates.

=SUMPRODUCT(--(WEEKDAY(Dates)=2))

Enter this array formula** in F1. This will extract the data from column C that corresponds to the Monday dates.

=IF(ROWS(F$1:F1)>E$1,"",INDEX(Data,SMALL(IF(WEEKDAY(Dates)=2,ROW(Dates)),ROWS(F$1:F1))))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

Copy down until you get blanks.
 
Upvote 0
Craig/if107, thanks, that does exactly what I want, Had looked at INDIRECT, but didn't know how to use it properly...

Biff/T Valko, thanks for your reply, I haven't tried this solution, but will print it out and add it to my folder for future use/investigation.

Gentlemen, thanks, I appreciate the efforts you have made to assist me.
Bob
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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