Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 186
Default Vlookup function macro

i have a series of tables that i need to select from, Below is a sample of
the if statement i have written. I need to copy this to multiple cells. Is
there a way to write a function macro to do the same thing?

=IF($O18=5,VLOOKUP(RateSheetDate,Table_PF_G5_T1,4) ,IF($O18=6,VLOOKUP(RateSheetDate,Table_PF_G6_T1,4) ,IF($O18=7,VLOOKUP(RateSheetDate,Table_PF_G7_T1,4) ,IF($O18=8,VLOOKUP(RateSheetDate,Table_PF_G8_T1,4) ,0))))
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Vlookup function macro

You may not need a macro. See if this works for you:

=VLOOKUP(RateSheetDate,INDIRECT("Table_PF_G"&$O18& "_T1"),4)

The INDIRECT function allows you to create a dynamic range reference based
upon the value in cell O18.

HTH
Elkar


"Jack" wrote:

i have a series of tables that i need to select from, Below is a sample of
the if statement i have written. I need to copy this to multiple cells. Is
there a way to write a function macro to do the same thing?

=IF($O18=5,VLOOKUP(RateSheetDate,Table_PF_G5_T1,4) ,IF($O18=6,VLOOKUP(RateSheetDate,Table_PF_G6_T1,4) ,IF($O18=7,VLOOKUP(RateSheetDate,Table_PF_G7_T1,4) ,IF($O18=8,VLOOKUP(RateSheetDate,Table_PF_G8_T1,4) ,0))))

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 186
Default Vlookup function macro

Works great - Thanks

"Elkar" wrote:

You may not need a macro. See if this works for you:

=VLOOKUP(RateSheetDate,INDIRECT("Table_PF_G"&$O18& "_T1"),4)

The INDIRECT function allows you to create a dynamic range reference based
upon the value in cell O18.

HTH
Elkar


"Jack" wrote:

i have a series of tables that i need to select from, Below is a sample of
the if statement i have written. I need to copy this to multiple cells. Is
there a way to write a function macro to do the same thing?

=IF($O18=5,VLOOKUP(RateSheetDate,Table_PF_G5_T1,4) ,IF($O18=6,VLOOKUP(RateSheetDate,Table_PF_G6_T1,4) ,IF($O18=7,VLOOKUP(RateSheetDate,Table_PF_G7_T1,4) ,IF($O18=8,VLOOKUP(RateSheetDate,Table_PF_G8_T1,4) ,0))))

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrate a Vlookup function in to a macro Arain Excel Discussion (Misc queries) 3 April 13th 07 12:52 PM
Specifying cell(s) for Vlookup Function in Macro Bill D. Toronto Excel Discussion (Misc queries) 5 February 20th 07 09:29 PM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Getting a cell address from Vlookup function in a macro? mickle026 New Users to Excel 3 June 17th 06 02:28 PM
Adding a Macro to a VLookup Function Wanda H. Excel Discussion (Misc queries) 1 August 16th 05 08:37 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"