+ Reply to Thread
Results 1 to 17 of 17

Code to Description

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Code to Description

    I'm looking for a simple solution to a form that my company is using.
    I have a form that I have my foremen fill out. I ask that he input a code for the work that was done and needs to be charged out to our customer. These codes correspond to a description of the work. For example, if his team trenches in x number of 6" pipe, I want him to input the corresponding code for that work.

    I want the spreadsheet to automatically produce a corresponding description in one cell when the foremen put in the code in another cell.

    For example, when he inputs the code A001 in cell C10 and hits enter, cell B10 automatically populates with the description 6in Trenched / Plow. I have a different tab with all of the codes and descriptions.

    I started building a formula in B10 with =IF(C10="A001","6in Trench / Plow",IF(C10="A002","4in Trench / Plow",IF(C10="A003","2in Trench / Plow",IF(C10=...

    It was working fine, but I soon realized that it would take a long, long time to do this as there are close to 300 codes. I also am not sure that an individual cell can support that many arguments anyway.

    Is there a way that this can be done easily? Or a way that the foreman can just select the code and it auto populates?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,021

    Re: Code to Description

    Look at VLOOKUP. My preference is to use a macro in the Sheet Change event. But others are more inclined to utilize a formula. I find formulas are sometimes confusing for me and difficult to put together. My $.02 cents.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description

    In B10, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    Quote Originally Posted by TMS View Post
    In B10, copied down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This is working. thank you much Trevor.

    The only pain point is that there are some duplicate values in the codes (Row 28, 29, 33, etc). To get around this, the foreman specifies which code with the Letter of the section.
    For example; If he needs to use the code for New Services - PE 2" at 0-50ft, he'll put B024 (Section B - Rows 37-53; Row 46). if he needs to use the code for Replacement Main - Bore Rock Adder 6", he'll put D024 (Section D - Rows 84-111; Row 109). When I input either code on the Foreman Work Sheet, it produces the description for B024 regardless.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description

    It's hard to anticipate such a requirement, or to deduce that it might exist. All your codes are numeric in the lookup table, hence the reason for extracting the numeric part.

    Please provide another sample file with all the typical variations.

    Given that all your previous examples had a letter and three digits, it might make everyone's life simpler if you used codes that reflected the input requirement. That would immediately remove the issue of duplicates and make the formula simpler.

  6. #6
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    Quote Originally Posted by TMS View Post
    It's hard to anticipate such a requirement, or to deduce that it might exist. All your codes are numeric in the lookup table, hence the reason for extracting the numeric part.

    Please provide another sample file with all the typical variations.

    Given that all your previous examples had a letter and three digits, it might make everyone's life simpler if you used codes that reflected the input requirement. That would immediately remove the issue of duplicates and make the formula simpler.
    Actually, I think I solved it. I added the letter to each of the three digit codes and changed the formula to look at five digits (we have AAxxx - QQxxx). That seems to have worked.

    Thanks.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description





    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    One (hopefully) last question.
    I have created another tab in the workbook for our admin side of things - we don't want our foreman to see the costs, so I'll hide that tab. I used the same formula with a reference to a different column to auto populate the costs and on the Admin Worksheet and also, to save keystrokes, had cells reference cells from the Foreman Worksheet. Unfortunately, it's throwing some undesired [I]#NAs[I] in cells that I'd like to have blank. It's impacting a sum cell that I need. I've attached the updated workbook to show what I'm seeing (I think).

    Thank you for all of your help. I will absolutely go in and star the posts.
    Attached Files Attached Files

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description

    One way:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Thanks for the rep

  10. #10
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    Worked like a charm. Thank you again.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,886

    Re: Code to Description

    Where is CheyWy in the world?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  12. #12
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    Cheyenne Wyoming

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    82,886

    Re: Code to Description

    OK - most people won't know that, so please add USA to your location.

    It could be important that members have a rough idea of your location as the solutions they offer may be affected by your locale. For instance, you might in the future post questions which are related to your regional settings.

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description

    Quote Originally Posted by quinwyo View Post
    One (hopefully) last question.
    I have created another tab in the workbook for our admin side of things - we don't want our foreman to see the costs, so I'll hide that tab. I used the same formula with a reference to a different column to auto populate the costs and on the Admin Worksheet and also, to save keystrokes, had cells reference cells from the Foreman Worksheet. Unfortunately, it's throwing some undesired [I]#NAs[I] in cells that I'd like to have blank. It's impacting a sum cell that I need. I've attached the updated workbook to show what I'm seeing (I think).

    Thank you for all of your help. I will absolutely go in and star the posts.
    Please be aware that, just because a sheet is hidden, it doesn't mean that anyone (like the Foreman) won't be able to access it and/or be able to access the content. I can't really go into much more detail here, but just be warned.

  15. #15
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    Quote Originally Posted by AliGW View Post
    OK - most people won't know that, so please add USA to your location.

    It could be important that members have a rough idea of your location as the solutions they offer may be affected by your locale. For instance, you might in the future post questions which are related to your regional settings.
    Smart. I will do that.

  16. #16
    Registered User
    Join Date
    04-16-2013
    Location
    CheyWy, USA
    MS-Off Ver
    Excel for Microsoft 365 MSO (Version 2304...)
    Posts
    11

    Re: Code to Description

    I am aware of that, but thanks for the heads up.

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,974

    Re: Code to Description

    Ok. . . . . . . .

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What code will come for the problem in description
    By AUDIS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-04-2019, 11:26 AM
  2. [SOLVED] Drop List with a description but once chosen description disappear
    By dezspert22 in forum Excel General
    Replies: 22
    Last Post: 12-19-2016, 05:24 PM
  3. Please Write code for respective Description
    By sai0449 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2015, 12:22 PM
  4. Code description
    By vio.coman in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-09-2014, 05:18 AM
  5. Function required to add description to code within spreadsheet
    By JulieRayner in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2014, 11:13 AM
  6. [SOLVED] If code same combine the description
    By Klitos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2013, 05:16 AM
  7. lists in excel how to match code with description
    By Nicki1966 in forum Excel General
    Replies: 2
    Last Post: 04-08-2009, 05:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1