Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Vlookup with If Statement

Folks,

I have the following scenario:

My lookup table (Sheet 1) contains:
A: Product #
B: Total numbers of lbs.

My main table (Sheet 2) [where the vlookup function resides] has the
following:

A: Product #
B: # of Units

So, let's say, in Column C (in Sheet 2) I am trying to write a vlookup
formula that will look up Product # in Sheet 1 and return the Total number of
lbs. I want to incorporate the additional formula where if it finds the
lookup value then it divides the Total number of lbs. by the # of units.
That's what I am looking for: Lookup A1 in Sheet1 A:B, return B but divide it
by # of units.

Hope this helps. Thanks .

Regards,
Shams.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Vlookup with If Statement

Don't know why you have started a new thread, but this should do what
you want in C1 of Sheet 2:

=VLOOKUP(A1,'Sheet1'!A:B,2,0)/B1

If there is a chance that the Product # in Sheet 2 is not present in
Sheet 1, you might like to amend is as follows:

=IF(ISNA(VLOOKUP(A1,'Sheet1'!A:B,2,0)),"",VLOOKUP( A1,'Sheet1'!A:B,2,0)/B1)

Hope this helps.

Pete

Shams wrote:
Folks,

I have the following scenario:

My lookup table (Sheet 1) contains:
A: Product #
B: Total numbers of lbs.

My main table (Sheet 2) [where the vlookup function resides] has the
following:

A: Product #
B: # of Units

So, let's say, in Column C (in Sheet 2) I am trying to write a vlookup
formula that will look up Product # in Sheet 1 and return the Total number of
lbs. I want to incorporate the additional formula where if it finds the
lookup value then it divides the Total number of lbs. by the # of units.
That's what I am looking for: Lookup A1 in Sheet1 A:B, return B but divide it
by # of units.

Hope this helps. Thanks .

Regards,
Shams.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Vlookup with If Statement

Pete,
Thanks for your reply. Your suggestion works just fine. A simple thing to
conceptualize but somehow I closed my mind by trying to focus on an IF
statement.

"Shams" wrote:

Folks,

I have the following scenario:

My lookup table (Sheet 1) contains:
A: Product #
B: Total numbers of lbs.

My main table (Sheet 2) [where the vlookup function resides] has the
following:

A: Product #
B: # of Units

So, let's say, in Column C (in Sheet 2) I am trying to write a vlookup
formula that will look up Product # in Sheet 1 and return the Total number of
lbs. I want to incorporate the additional formula where if it finds the
lookup value then it divides the Total number of lbs. by the # of units.
That's what I am looking for: Lookup A1 in Sheet1 A:B, return B but divide it
by # of units.

Hope this helps. Thanks .

Regards,
Shams.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Vlookup with If Statement

Glad it worked for you - thanks for feeding back.

Pete

Shams wrote:
Pete,
Thanks for your reply. Your suggestion works just fine. A simple thing to
conceptualize but somehow I closed my mind by trying to focus on an IF
statement.

"Shams" wrote:

Folks,

I have the following scenario:

My lookup table (Sheet 1) contains:
A: Product #
B: Total numbers of lbs.

My main table (Sheet 2) [where the vlookup function resides] has the
following:

A: Product #
B: # of Units

So, let's say, in Column C (in Sheet 2) I am trying to write a vlookup
formula that will look up Product # in Sheet 1 and return the Total number of
lbs. I want to incorporate the additional formula where if it finds the
lookup value then it divides the Total number of lbs. by the # of units.
That's what I am looking for: Lookup A1 in Sheet1 A:B, return B but divide it
by # of units.

Hope this helps. Thanks .

Regards,
Shams.


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
If Statement with VLookup Shams Excel Worksheet Functions 3 October 16th 06 07:16 PM
Nested IF statement with VLOOKUP James Hamilton Excel Discussion (Misc queries) 1 August 16th 06 07:46 AM
Vlookup 'And' statement moglione1 Excel Discussion (Misc queries) 1 March 9th 06 04:02 PM
Vlookup or If statement Help JPriest Excel Worksheet Functions 7 June 28th 05 08:00 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM


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