Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dan Belcher
 
Posts: n/a
Default VLOOKUP and multiple columns

Here's a question for an assignment for my computer info systems class.

I have a table posted below in cells A4:E13

Credit National National National National
Rating Area Area Area Area
Score 111 112 113 114
300 3.00% 3.00% 3.00% 3.00%
325 3.25% 3.25% 3.25% 3.25%
350 3.50% 3.50% 3.50% 3.50%
475 4.25% 4.50% 4.75% 5.00%
550 4.50% 4.75% 5.00% 5.75%
650 5.50% 5.25% 6.00% 6.50%
750 6.50% 5.75% 7.00% 7.25%

Shipping Rate Per Pound Shipped is $4.00 (4 is placed in cell E16)

B21:G25 for this partial example of the table...
Credit Shipping Total Total
Customer Rating Destination Weight to Discount Shipping
Number Score Area Ship (lbs.) Amount Cost Invoiced
100234 487 111 2,987 ? ?
100543 300 114 15,487 ? ?
etc. etc. etc...

I need to calculate the Discount Amount based upon a customer's credit
rating score and from there calculate the total shipping cost for that
customer. I must do this TWO ways using the VLOOKUP function. I must do
these both where I only have to type the formula once and can just copy it
down for each row of the table that calculates shipping costs. I must
provide two versions of the VLOOKUP formulas: 1) VLOOKUP using a nested IF
to definte the col_ind_num, and 2) VLOOKUP using a calculation to define the
col_ind_num.

I cannot figure out how to properly use the function -without- using nested
IF functions. Any suggestions?

P.S.
The current formula I have is
=VLOOKUP(C24,$A$5:$E$13,IF(D24=$B$6,2,IF(D24=$C$6, 3,IF(D24=$D$6,4,IF(D24=$E$6,5)))),TRUE)*E24*$E$16
  #2   Report Post  
Dan Belcher
 
Posts: n/a
Default

Okay, nevermind that. I've figured it out. I used
=IF(B24="",0,(VLOOKUP(C24,$A$5:$E$13,(D24-109),TRUE)*E24*$E$16))

Now, I do have an additional problem. I must repeat this question except
using HLOOKUP instead of VLOOKUP. I am open to suggestions on that now.
  #3   Report Post  
Max
 
Posts: n/a
Default

"Dan Belcher" wrote:
.. I must repeat this question except
using HLOOKUP instead of VLOOKUP. Try:


=HLOOKUP(D24,$A$6:$E$13,
MATCH(C24,$A$6:$A$13,TRUE),0)*E24*$E$16
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #4   Report Post  
Dan Belcher
 
Posts: n/a
Default

Actually, a little caffeine and transposing the table solved my problems.
Got it working fine now. Thanks for the help though!

"Max" wrote:

"Dan Belcher" wrote:
.. I must repeat this question except
using HLOOKUP instead of VLOOKUP. Try:


=HLOOKUP(D24,$A$6:$E$13,
MATCH(C24,$A$6:$A$13,TRUE),0)*E24*$E$16
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--



  #5   Report Post  
Max
 
Posts: n/a
Default

Your'e welcome, Dan !
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #6   Report Post  
Biff
 
Posts: n/a
Default

Hi!

The current formula I have is
=VLOOKUP(C24,$A$5:$E$13,IF(D24=$B$6,2,IF(D24=$C$6 ,3,IF(D24=$D$6,4,IF(D24=$E$6,5)))),TRUE)*E24*$E$1 6


I realize this is just an exercise for learning purposes, but no "good"
spreadsheet designer would ever use that formula!

=IF(B24="",0,(VLOOKUP(C24,$A$5:$E$13,(D24-109),TRUE)*E24*$E$16))


While that may work, this is better:

=IF(E24="",0,VLOOKUP(C24,A5:E13,MATCH(D24,A6:E6,0) ,1)*E24*E16)

You should base your "blank cell" on the last cell that needs to hold data.
If you use your formula and as you enter the data, as soon as you enter the
Customer ID the formula will return #N/A until you enter the credit score
and region.

I must repeat this question except using HLOOKUP


Hlookup works the same way except the criteria references are just the
opposite of Vlookup: You want to lookup the region and match the rate as
opposed to lookup the rate and match the region:

=IF(E24="",0,HLOOKUP(D24,A6:E13,MATCH(C24,A6:A13,1 ),0)*E24*E16)

Good luck with the IF version of the Hlookup!

Biff

"Dan Belcher" wrote in message
...
Okay, nevermind that. I've figured it out. I used
=IF(B24="",0,(VLOOKUP(C24,$A$5:$E$13,(D24-109),TRUE)*E24*$E$16))

Now, I do have an additional problem. I must repeat this question except
using HLOOKUP instead of VLOOKUP. I am open to suggestions on that now.



  #7   Report Post  
Max
 
Posts: n/a
Default

"Dan Belcher" wrote:
... I cannot figure out how to properly use the function
-without- using nested IF functions
The current formula I have is

=VLOOKUP(C24,$A$5:$E$13,IF(D24=$B$6,2,IF(D24=$C$6, 3,IF(D24=$D$6,4,IF(D24=$E$
6,5)))),TRUE)*E24*$E$16

One way

Try:

=VLOOKUP(C24,$A$5:$E$13,
MATCH(D24,$A$6:$E$6,0),TRUE)*E24*$E$16

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


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
vlookup from multiple columns JR Excel Worksheet Functions 12 May 4th 05 05:10 PM
vlookup for multiple columns [email protected] Excel Worksheet Functions 0 April 22nd 05 07:28 PM
vlookup for multiple columns MXC Excel Worksheet Functions 6 March 4th 05 09:59 PM
Can VLOOKUP return multiple answers based on several identical lo. jddtct Excel Worksheet Functions 3 January 11th 05 07:03 AM
Multiple Vlookup? changeable Excel Worksheet Functions 0 November 9th 04 11:52 AM


All times are GMT +1. The time now is 11:51 AM.

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

About Us

"It's about Microsoft Excel"