Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rod Rod is offline
external usenet poster
 
Posts: 108
Default VLOOKUP Converted to VB

After days of running into Excel limitations I have resorted to trying to do
this in VB (definitely not my strength). I have too many nested conditionals
for Excel to handle so I wanted to create a function in VB. I need to
convert VLOOKUP(D50,INDIRECT(D50&"_Contract"),2,FALSE) to the VB equivalent.
DLookup looks to be the best I could find, but one clear problem I forsee is
DLookup is using text and my commision table is full of numbers. Most of the
table on a different tab than the computations looks like this:

Life LTC $MART H.O.M.E. G.O.O.D. M Funds
REP 25% 10.00% 0.31% 0.31% 0.31% 30.00%
SREP 35% 15.50% 0.36% 0.36% 0.36% 32.50%
DIS 50% 20.00% 0.44% 0.44% 0.44% 35.00%
DIV 60% 25.00% 0.57% 0.57% 0.57% 37.50%
REG 70% 30.00% 0.83% 0.83% 0.83% 42.50%
SREG 80% 35.00% 0.83% 0.83% 0.83% 47.50%
RVP 95% 40.00% 1.23% 1.23% 1.25% 62.00%


D51 is SREG. So, in E51 I am looking up what the Life Product compensation
for a SREG when the customer pays an E19 premium. If E19, Life_Prem, was
$100, then
E51=VLOOKUP(D51,INDIRECT(D51&"_Contract"),2,FALSE) *(Life_Prem*12)*75%)*82.226%),
where SREG_Contract is a named range from the above SREG through to 47.50%
horizontally. SREG's commission is 80%; E51 should return 80%*100*12*75%=720

Your help is VERY appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 89
Default VLOOKUP Converted to VB

Rod,

Have you looked at using the SUMPRODUCT function? With it you can use many
conditions. You would use it like this:

-SUMPRODUCT(--(Contract="SREG"),--(Second
Condition="Whatever"),--(Third="More"), Life_Premium)

As long as all of your conditions limit it to one answer you will get the
one result you want. If it results in multiple answers then it would sum
them together. I'm not sure if this work for you but you might look into it
and see if it will.

Mike

"Rod" wrote:

After days of running into Excel limitations I have resorted to trying to do
this in VB (definitely not my strength). I have too many nested conditionals
for Excel to handle so I wanted to create a function in VB. I need to
convert VLOOKUP(D50,INDIRECT(D50&"_Contract"),2,FALSE) to the VB equivalent.
DLookup looks to be the best I could find, but one clear problem I forsee is
DLookup is using text and my commision table is full of numbers. Most of the
table on a different tab than the computations looks like this:

Life LTC $MART H.O.M.E. G.O.O.D. M Funds
REP 25% 10.00% 0.31% 0.31% 0.31% 30.00%
SREP 35% 15.50% 0.36% 0.36% 0.36% 32.50%
DIS 50% 20.00% 0.44% 0.44% 0.44% 35.00%
DIV 60% 25.00% 0.57% 0.57% 0.57% 37.50%
REG 70% 30.00% 0.83% 0.83% 0.83% 42.50%
SREG 80% 35.00% 0.83% 0.83% 0.83% 47.50%
RVP 95% 40.00% 1.23% 1.23% 1.25% 62.00%


D51 is SREG. So, in E51 I am looking up what the Life Product compensation
for a SREG when the customer pays an E19 premium. If E19, Life_Prem, was
$100, then
E51=VLOOKUP(D51,INDIRECT(D51&"_Contract"),2,FALSE) *(Life_Prem*12)*75%)*82.226%),
where SREG_Contract is a named range from the above SREG through to 47.50%
horizontally. SREG's commission is 80%; E51 should return 80%*100*12*75%=720

Your help is VERY appreciated!

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
Automatically it should be converted Srikanth Excel Discussion (Misc queries) 11 January 25th 08 09:53 AM
I want 148:30 converted to 148.5 and I am an idiot element04 Excel Discussion (Misc queries) 1 July 13th 06 01:41 AM
Answer to 2/29 gets converted to 2/1 Gary''s Student Excel Discussion (Misc queries) 0 March 21st 06 06:41 PM
h:mm:ss AM + h:mm:ss AM converted to minutes? Ryan Cain New Users to Excel 1 August 11th 05 09:30 AM
How can a value be converted to words Azar Excel Discussion (Misc queries) 1 March 5th 05 06:47 PM


All times are GMT +1. The time now is 07:04 PM.

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"