PC Review


Reply
Thread Tools Rate Thread

Column index in Vlookup

 
 
Khalil Handal
Guest
Posts: n/a
 
      30th Aug 2007
Hi,
I have a lot of vlookup formulas that looks like this one:
Cell E21=VLOOKUP($A$3,Marks!$F$14:$DG$65,30,FALSE)
Cell E22=VLOOKUP($A$3,Marks!$F$14:$DG$65,36,FALSE)

The difference of 6 is for the next formula.
When I do some changes in the sheet Marks the column index is changed and I
have to do it manualy.
Is there a way that this can be done automatically? (ie. add 6 each time)
this makes it more easy to work. I copy the cell E21 down for the other
formulas and the number are changed 30, 36, 42 ...


 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      30th Aug 2007
Instead of putting 30, 36, 42 etc in the formulae explicitly, you can
calculate what it should be from the row that it is on. Here's an
example which works in a cell on row 21:

=(ROW()-20)*6+24

or, better still:

=ROW(A1)*6+24

(better because it is independent of the row you put it on)

This will return 30. If you copy it down it will return 36, 42 etc on
successive rows. So, just replace your first 30 with ROW(A1)*6+24 in
the formula in E21. Your formula might also become a bit easier to
read if you define a named range for Marks!$F$14:$DG$65 (eg call it
table), then your formula becomes:

=VLOOKUP($A$3,table,30,FALSE)

or with my suggestions above:

=VLOOKUP($A$3,table,ROW(A1)*6+24,FALSE)

Note that if you move this formula onto a different row (eg by
inserting rows above it), then it should still work.

Hope this helps.

Pete


On Aug 30, 2:31 pm, "Khalil Handal" <khhan...@stthom.edu> wrote:
> Hi,
> I have a lot of vlookup formulas that looks like this one:
> Cell E21=VLOOKUP($A$3,Marks!$F$14:$DG$65,30,FALSE)
> Cell E22=VLOOKUP($A$3,Marks!$F$14:$DG$65,36,FALSE)
>
> The difference of 6 is for the next formula.
> When I do some changes in the sheet Marks the column index is changed and I
> have to do it manualy.
> Is there a way that this can be done automatically? (ie. add 6 each time)
> this makes it more easy to work. I copy the cell E21 down for the other
> formulas and the number are changed 30, 36, 42 ...



 
Reply With Quote
 
Khalil Handal
Guest
Posts: n/a
 
      30th Aug 2007
Hi Pete,
It cannot be more clear. Thanks a lot. I understood it and it works fine.


"Pete_UK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Instead of putting 30, 36, 42 etc in the formulae explicitly, you can
> calculate what it should be from the row that it is on. Here's an
> example which works in a cell on row 21:
>
> =(ROW()-20)*6+24
>
> or, better still:
>
> =ROW(A1)*6+24
>
> (better because it is independent of the row you put it on)
>
> This will return 30. If you copy it down it will return 36, 42 etc on
> successive rows. So, just replace your first 30 with ROW(A1)*6+24 in
> the formula in E21. Your formula might also become a bit easier to
> read if you define a named range for Marks!$F$14:$DG$65 (eg call it
> table), then your formula becomes:
>
> =VLOOKUP($A$3,table,30,FALSE)
>
> or with my suggestions above:
>
> =VLOOKUP($A$3,table,ROW(A1)*6+24,FALSE)
>
> Note that if you move this formula onto a different row (eg by
> inserting rows above it), then it should still work.
>
> Hope this helps.
>
> Pete
>
>
> On Aug 30, 2:31 pm, "Khalil Handal" <khhan...@stthom.edu> wrote:
>> Hi,
>> I have a lot of vlookup formulas that looks like this one:
>> Cell E21=VLOOKUP($A$3,Marks!$F$14:$DG$65,30,FALSE)
>> Cell E22=VLOOKUP($A$3,Marks!$F$14:$DG$65,36,FALSE)
>>
>> The difference of 6 is for the next formula.
>> When I do some changes in the sheet Marks the column index is changed and
>> I
>> have to do it manualy.
>> Is there a way that this can be done automatically? (ie. add 6 each time)
>> this makes it more easy to work. I copy the cell E21 down for the other
>> formulas and the number are changed 30, 36, 42 ...

>
>



 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      30th Aug 2007
Thanks for feeding back, Khalil.

Pete

On Aug 30, 6:26 pm, "Khalil Handal" <khhan...@stthom.edu> wrote:
> Hi Pete,
> It cannot be more clear. Thanks a lot. I understood it and it works fine.
>
> "Pete_UK" <pashu...@auditel.net> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > Instead of putting 30, 36, 42 etc in the formulae explicitly, you can
> > calculate what it should be from the row that it is on. Here's an
> > example which works in a cell on row 21:

>
> > =(ROW()-20)*6+24

>
> > or, better still:

>
> > =ROW(A1)*6+24

>
> > (better because it is independent of the row you put it on)

>
> > This will return 30. If you copy it down it will return 36, 42 etc on
> > successive rows. So, just replace your first 30 with ROW(A1)*6+24 in
> > the formula in E21. Your formula might also become a bit easier to
> > read if you define a named range for Marks!$F$14:$DG$65 (eg call it
> > table), then your formula becomes:

>
> > =VLOOKUP($A$3,table,30,FALSE)

>
> > or with my suggestions above:

>
> > =VLOOKUP($A$3,table,ROW(A1)*6+24,FALSE)

>
> > Note that if you move this formula onto a different row (eg by
> > inserting rows above it), then it should still work.

>
> > Hope this helps.

>
> > Pete

>
> > On Aug 30, 2:31 pm, "Khalil Handal" <khhan...@stthom.edu> wrote:
> >> Hi,
> >> I have a lot of vlookup formulas that looks like this one:
> >> Cell E21=VLOOKUP($A$3,Marks!$F$14:$DG$65,30,FALSE)
> >> Cell E22=VLOOKUP($A$3,Marks!$F$14:$DG$65,36,FALSE)

>
> >> The difference of 6 is for the next formula.
> >> When I do some changes in the sheet Marks the column index is changed and
> >> I
> >> have to do it manualy.
> >> Is there a way that this can be done automatically? (ie. add 6 each time)
> >> this makes it more easy to work. I copy the cell E21 down for the other
> >> formulas and the number are changed 30, 36, 42 ...- Hide quoted text -

>
> - Show quoted text -



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Using INDEX & MATCH to VLOOKUP prior column Bassman62 Microsoft Excel Worksheet Functions 0 14th May 2009 07:35 PM
Vlookup, Column Index Num and Autofill mp Microsoft Excel Worksheet Functions 9 27th Apr 2009 07:44 PM
VLOOKUP Column Index Nate Microsoft Excel Misc 5 5th Mar 2009 07:11 PM
Multiple Column Index Number in VLookup GorillaBoze Microsoft Excel Worksheet Functions 8 28th Oct 2005 05:06 PM
Vlookup; dynamic column index =?Utf-8?B?QUs=?= Microsoft Excel Worksheet Functions 2 20th Oct 2004 02:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 AM.