Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default VLOOKUP within VLOOKUP

Hello, I'm using VLOOKUP tables and have a problem entering a
formula/function. For example, the data I'm using concerns engine capacity
and fuel types; this data is laid out as follows

Capacity Petrol Diesel (This table is named 'PETROL2 and starts in cell A3)
0 £0.30 £0.20
1100 £0.40 £0.30
1300 £0.42 £0.32
1600 £0.45 £0.35
2000 £0.47 £0.37

Miles Capacity Type Cost (starts in B12)
10 1100 P £0.40 (Formula:
=IF(D12="P",VLOOKUP(C12,PETROL2,2),IF(D12="D",VLOO KUP(D12,PETROL2,3)))
200 1297 P £0.40
300 1100 D #N/A
50 2000 P £0.47
100 1600 D #N/A

What I need is a formula that will return the total cost of the Diesel
entries. As you can see the Petrol entries are there! Please help, I really
can't see where I'm going wrong.
--
Cheers, V
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default VLOOKUP within VLOOKUP

I think the mistake is in using D12 as the lookup value in the second one...
Try
=IF(D12="P",VLOOKUP(C12,PETROL2,2),IF(D12="D",VLOO KUP(C12,PETROL2,3)))

i.e. both VLOOKUP should have VLOOKUP(C12,PETROL2, followed by either 2 or
3...
"VivienW" wrote:

Hello, I'm using VLOOKUP tables and have a problem entering a
formula/function. For example, the data I'm using concerns engine capacity
and fuel types; this data is laid out as follows

Capacity Petrol Diesel (This table is named 'PETROL2 and starts in cell A3)
0 £0.30 £0.20
1100 £0.40 £0.30
1300 £0.42 £0.32
1600 £0.45 £0.35
2000 £0.47 £0.37

Miles Capacity Type Cost (starts in B12)
10 1100 P £0.40 (Formula:
=IF(D12="P",VLOOKUP(C12,PETROL2,2),IF(D12="D",VLOO KUP(D12,PETROL2,3)))
200 1297 P £0.40
300 1100 D #N/A
50 2000 P £0.47
100 1600 D #N/A

What I need is a formula that will return the total cost of the Diesel
entries. As you can see the Petrol entries are there! Please help, I really
can't see where I'm going wrong.
--
Cheers, V

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default VLOOKUP within VLOOKUP

Thank you so much!! I can't tell you how long I've been playing around with
this. :)
--
Cheers, V


"Sheeloo" wrote:

I think the mistake is in using D12 as the lookup value in the second one...
Try
=IF(D12="P",VLOOKUP(C12,PETROL2,2),IF(D12="D",VLOO KUP(C12,PETROL2,3)))

i.e. both VLOOKUP should have VLOOKUP(C12,PETROL2, followed by either 2 or
3...
"VivienW" wrote:

Hello, I'm using VLOOKUP tables and have a problem entering a
formula/function. For example, the data I'm using concerns engine capacity
and fuel types; this data is laid out as follows

Capacity Petrol Diesel (This table is named 'PETROL2 and starts in cell A3)
0 £0.30 £0.20
1100 £0.40 £0.30
1300 £0.42 £0.32
1600 £0.45 £0.35
2000 £0.47 £0.37

Miles Capacity Type Cost (starts in B12)
10 1100 P £0.40 (Formula:
=IF(D12="P",VLOOKUP(C12,PETROL2,2),IF(D12="D",VLOO KUP(D12,PETROL2,3)))
200 1297 P £0.40
300 1100 D #N/A
50 2000 P £0.47
100 1600 D #N/A

What I need is a formula that will return the total cost of the Diesel
entries. As you can see the Petrol entries are there! Please help, I really
can't see where I'm going wrong.
--
Cheers, V

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default VLOOKUP within VLOOKUP

You are most welcome.

This happens to all of us... I spent one hour today and finally traced the
error to an extra Carriage Return (in MS Word)

"VivienW" wrote:

Thank you so much!! I can't tell you how long I've been playing around with
this. :)
--
Cheers, V

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 - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
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
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 11:56 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"