Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Josh O.
 
Posts: n/a
Default Lookup function w/Text and Year

I am trying to create a formula to lookup a product number and return the
product description. Some of the items numbers are comprised of product
number and date. For example, item 9601 is for "Book Name 2001" and 9602 is
for "Book Name 2002."

Is there a way to make a formula lookup the 4 digit product number and if
the lookup array only contains 2 digits use the last two digits of product
number to fill in the year on the product description.

For example:
Lookup Array:
Item Number: 96__ Item description: Book Name 20__
Item Number: 97__ Item description: Item 2 Name 20__
Item Number: 5655 Item description: Item 3 Name

Spreadsheet 1:
Lookup Value 1: 9605 Result: Book Name 2005
Lookup Value 2: 9704 Result: Item 2 Name 2004
Lookup Value 3: 5655 Result: Item 3 Name

Any Ideas would be appreciated?
  #2   Report Post  
nbrcrunch
 
Posts: n/a
Default


You can use a secondary field as your true look that examines the user's
input and if it string only has two digits at the end, then insert "20"
in front of it. However, your formula logic looks like it is going to
get "hairy" seeing as it also has to determine whether or not to use
"19" or "20"

Essentially, use the AND operator (ampersand) to concatenate the
string

In plain English, the formula would be

If the 3rd to the last character in the input string is not numeric,
then
the NewLookUpValue equals the OriginalInputString up and including the
3rd to the last character AND "20" AND the last two characters of the
OriginalInputString.

=IF(right(OriginalInput,3)9,mid(OriginalInput,1,l en(OriginalInput)-3)&"20"&right(OriginalInput,3),OriginalInput)


--
nbrcrunch
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
Month Year Date Format Jamie Excel Worksheet Functions 2 February 7th 05 06:43 PM
Need totals of values that fall within a given year Pierre Excel Worksheet Functions 12 January 5th 05 04:45 PM
Weeknum Year by Year Compare RJB Charts and Charting in Excel 4 December 29th 04 10:33 PM
Double entry lookup Al Eaton Excel Worksheet Functions 2 December 13th 04 03:25 AM
Function Help Steven M. Britton Excel Worksheet Functions 0 December 9th 04 03:33 PM


All times are GMT +1. The time now is 12:37 PM.

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"