Previous in Forum: MP3 Player Firmware   Next in Forum: What's So Great About IPv6?
Close
Close
Close
9 comments
Rate Comments: Nested
Power-User
United States - Member - New Member Engineering Fields - Biomedical Engineering - Radiation Oncology Engineering Hobbies - Fishing - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - Hunting - New Member Hobbies - DIY Welding - New Member Hobbies - Target Shooting - New Member Popular Science - Biology - New Member

Join Date: Sep 2006
Location: CT
Posts: 267
Good Answers: 1

Excel Formulas for Auto Populate

04/08/2009 9:59 AM

Hello All

I am using Excell 2003 to log service hours from a vendor. The service report has an FSR# that is unique. In my spread sheet I have 3 columns, FSR#, Badge # and Rep amongst others.

The format of the FSR # is H#####-ABCD-ABC123 (ex h87654-sjey-7m666f). The first set of numbers pertain to the badge # , I like to show in the worksheet. Currently I re-enter just the badge #, ex. 87654, into the cell. The next cell contains the formula =VLOOKUP(D282,Rep,2,FALSE) which then populate the cell with the Reps name.

I am lazy and do not want to retype the badge #. When researching how to stay lazy I found two formulas that populate the cell, "=LEFT($C280,FIND("-",$C280)-1)" and "=MID($C281,2,5)", where c281 is the FSR #. The problems I encounter with the first formula is that the leading "h" follows the number. I can get around this by changing the primary lookup value in the table. ( I actually did this but it bugs me that I cannot get rid of the "h"). The second formula actually populate the badge # field correctly but then the lookup does not work. I get N/A which just pisses me off. I know, better pissed off than pissed on.

Do any of you great intelects out there have a solution that will work and allow me keep my lazy status.

Thanks

Bob

__________________
“Sometimes we don't even realize what we really care about, because we get so distracted by the symbols.” ? Tom Wolfe, The Electric Kool-Aid Acid Test
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Aug 2007
Location: Earth - I think.
Posts: 2143
Good Answers: 165
#1

Re: Excel Formulas for Auto Populate

04/08/2009 1:08 PM
Formulas=FIND("-",$A3,1)=FIND("-",$A3,B3+1)=LEFT(A3,1)=MID($A3,2,$B3-2)
FSRFirst dashSecond dashPrefixBadge
h87654-sjey-7m666f712h87654

Once you make the formulas, you can then "Hide" those columns.

__________________
TANSTAAFL (If you don't know what that means, Google it - yourself)
Register to Reply
Power-User
United States - Member - New Member Engineering Fields - Biomedical Engineering - Radiation Oncology Engineering Hobbies - Fishing - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - Hunting - New Member Hobbies - DIY Welding - New Member Hobbies - Target Shooting - New Member Popular Science - Biology - New Member

Join Date: Sep 2006
Location: CT
Posts: 267
Good Answers: 1
#2
In reply to #1

Re: Excel Formulas for Auto Populate

04/09/2009 6:54 AM

Kilowatt,

Thanks for answering.

When I plug in your formulas I get the correct badge # for a result, just like I did when I used =MID($C281,2,5). The problem is that the vlookup function (=VLOOKUP(D282,Rep,2,FALSE) fails and reports a N/A.

I am assuming the the MID command does some kind of formating of the result that make is unusable with vlookup. If I use the formula =LEFT($C281,FIND("-",$C281)-1) I get a usable result. Go figure

rlindey

__________________
“Sometimes we don't even realize what we really care about, because we get so distracted by the symbols.” ? Tom Wolfe, The Electric Kool-Aid Acid Test
Register to Reply
Power-User
United States - Member - New Member Engineering Fields - Chemical Engineering - New Member

Join Date: Apr 2007
Location: Austin, TX
Posts: 367
Good Answers: 10
#3

Re: Excel Formulas for Auto Populate

04/09/2009 9:48 AM

N/A could be because your system is looking for a number but when you use the LEFT or MID functions, it returns a text value. Try multiplying the LEFT or MID output by 1 and then see if the VLOOKUP resolves itself.

__________________
Money doesn't talk, it screams in your face.
Register to Reply Score 1 for Good Answer
Active Contributor

Join Date: Feb 2009
Location: Warner Robins, GA
Posts: 16
Good Answers: 1
#4
In reply to #3

Re: Excel Formulas for Auto Populate

04/09/2009 10:05 AM

Bob,

betomachine has it right. You are probably saving your Badge Numbers as values and the MID or LEFT String functions leave a string (even though it looks like a number).

You could use the VALUE function with the MID function to get a value result.

=VALUE(MID($C281,2,5))

VALUE turns a text string into a value (as best as it can). In your case the string number would become a numeric value and would match the column of values in the Badge column of your table.

Calvin

Register to Reply
Power-User
United States - Member - New Member Engineering Fields - Biomedical Engineering - Radiation Oncology Engineering Hobbies - Fishing - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - Hunting - New Member Hobbies - DIY Welding - New Member Hobbies - Target Shooting - New Member Popular Science - Biology - New Member

Join Date: Sep 2006
Location: CT
Posts: 267
Good Answers: 1
#5
In reply to #4

Re: Excel Formulas for Auto Populate

04/09/2009 2:58 PM

Sorry Guys, neither of those suggestions worked. I still get the N/A

__________________
“Sometimes we don't even realize what we really care about, because we get so distracted by the symbols.” ? Tom Wolfe, The Electric Kool-Aid Acid Test
Register to Reply
Power-User
United States - Member - New Member Engineering Fields - Chemical Engineering - New Member

Join Date: Apr 2007
Location: Austin, TX
Posts: 367
Good Answers: 10
#6
In reply to #5

Re: Excel Formulas for Auto Populate

04/09/2009 3:03 PM

Bummer, I thought that would fix it. I'll hunt around and see if something makes more sense.

__________________
Money doesn't talk, it screams in your face.
Register to Reply
Power-User
United States - Member - New Member Engineering Fields - Biomedical Engineering - Radiation Oncology Engineering Hobbies - Fishing - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - Hunting - New Member Hobbies - DIY Welding - New Member Hobbies - Target Shooting - New Member Popular Science - Biology - New Member

Join Date: Sep 2006
Location: CT
Posts: 267
Good Answers: 1
#7
In reply to #5

Re: Excel Formulas for Auto Populate

04/09/2009 3:03 PM

OK, So while I played with formating before and did not get the reuslts to work i just tried formating the =(MID($C281,2,5)) cells as numbers and the results came in just as I wanted them. I had played with formating the cells in the lookup table array thinking that was the cause, not the actual cells.

Any way thanks for your replies.

Bob

__________________
“Sometimes we don't even realize what we really care about, because we get so distracted by the symbols.” ? Tom Wolfe, The Electric Kool-Aid Acid Test
Register to Reply
Guru

Join Date: Aug 2007
Location: Earth - I think.
Posts: 2143
Good Answers: 165
#8
In reply to #5

Re: Excel Formulas for Auto Populate

04/09/2009 3:14 PM
Nq=FIND("-",$A3,1)=FIND("-",$A3,B3+1)=LEFT(A3,1)=MID($A3,2,$B3-2)=VLOOKUP(F3,$H$3:$I$6,2,FALSE)NumName
NFSRFirst dashSecond dashPrefixBadgeNameNumName
87654h87654-sjey-7m666f712h87654bob87654bob
87657h87657-sjey-7m666f712h87657carol87657carol
87656h87656-sjey-7m666f712h87656ted87656ted
87657h87657-sjey-7m666f712h87657carol87657alice

This is the result that I got (Upper left corner is A1). One: All of the above cells are formatted as "General". Two: Note the "$" usage in the vlookup formula; since it is a table range, the start and end points must be fixed. Otherwise when you copy and paste the vlookup formula into other cells, it automatically readjusts them accordingly.

__________________
TANSTAAFL (If you don't know what that means, Google it - yourself)
Register to Reply
Guru
Engineering Fields - Electromechanical Engineering - Technical Services Manager Canada - Member - Army brat Popular Science - Cosmology - What is Time and what is Energy? Technical Fields - Architecture - Draftsperson Hobbies - RC Aircraft - New Member

Join Date: Sep 2006
Location: Clive, Alberta, Canada
Posts: 5916
Good Answers: 204
#9

Re: Excel Formulas for Auto Populate

04/09/2009 3:28 PM

I have built a spreadsheet very close to this, programmed with VBA... uses an activeX flexgrid.. but works well for filling in the blanks.. extraneous data is on a second sheet.

send email if interested... or if there is enough interest, I can post the instructions and code, explaining how to tailor it to your needs.

please make sure your application descriptions are thorough, as I have many examples I've built over the last few years.. and can provide more value if I know more thoroughly what your requirements are.

Chris

Register to Reply
Register to Reply 9 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

betomachine (2); chrisg288 (1); Farmers Son (1); Kilowatt0 (2); rlindey (3)

Previous in Forum: MP3 Player Firmware   Next in Forum: What's So Great About IPv6?
You might be interested in: Cell Processors, Battery and Fuel Cell Components

Advertisement