+ Reply to Thread
Results 1 to 20 of 20

Changing values based on existing data

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Changing values based on existing data

    Hello everyone!

    I’m pretty sure it’s something that can be done and I’ll try to explain this as clearly as I can.

    I have to generate an inventory list of various products from Dynamics GP. I can export my smartlist into an excel file so that part is easy. I have, in column A, the list of items in my inventory (see picture 1). In that same file, I also have column B, which are the quantities of each items. I want to run this “formula” so that it does a search for specific items and modifies the quantity for that said item. I have about two hundred lines but some quantities can’t be known by our customers (some are in stock at over a thousand).

    Picture 1 has to become Picture 2 in a few mouse clicks.

    Here’s the best way to explain all of this:

    If cell Ax (x being the line for that value) contains “500Gb Hard Drive”, then cell Bx = random number between 50 & 60.

    I have about 70 items I need to change the quantities for but they’re always the same.


    Also, even though I’m 99% sure the answer to my previous question will be the same for this one, I’ll just make sure I’m on the right path.

    After all my quanties have been changed, I’d like to add values to C.

    If you find “Hard Drive” somewhere in A, add HDD to C.

    If I could have the body of the “formula” so that I could just replace the value for each of the 20-ish items for every line, it would be great. I think that would probably require a VB module but I’m not sure. As long as I can paste only the values, I don’t care how I get there. It has to be automated in some way, meaning that I would just have to run the “module”.


    Thanks a lot for your help, I’ve been doing those changes manually for the last 2 years and it would be of great help.
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    Please post a workbook with a good sample of data, rather than a picture.

  3. #3
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    Here's a sample of my inventory list because obviously, I don't want all of my company's stuff all over the internet.

    I could easily do something like B=Ax/2 but it's not that simple. If a line disappears because we're back order on that product or if that product is discontinued (because only items that are in stock are generated by our smartlist), then if whatever formula was cell specific (instead of column specific), then it wouldn't work because there's a rotation of at least 50 items every week.

    Thanks in advance!
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    OK, that's a start, but what now? What is supposed to happen, I don't follow - where do the values in B and C come from?

  5. #5
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    B's are the number of each items we have in stock. They're generated automaticaly by Dynamics GP 10.0, according to what we received from our distributors and what we sold to our customers.

    C's are like a category that I'd like to add after exporting my report (it can't be managed by Dynamics right now for a few reasons). There are about 15 categories in total. Once the structure for what I want to do, I could change the "searched values" of A and the range for the random quantities.

    I have to "hide" my real quantities for different purposes so instead of showing let's say 1374 of X item, it shows as 73.

    Thank you for your time.

  6. #6
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    I might be being slow - entirely possible - but what do you want from a macro? Cols A and B are brought in from outside so do you just want to add col C? If so, what are the rules?

  7. #7
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    For B's, if I was to explain it to my excel program, this is how I'd do it, line by line:

    Line 1. If you find, in column A, the words 500GB HARD DRIVE 04184, put in column B, for each specific cell of the same line you found the words 500GB HARD DRIVE 04184 on, a random number between 50 and 60. (as in, you found 500GB HARD DRIVE 04184 in A10, put a random number between 50-60 in B)

    Line 2. If you find, in column A, the words 500GB HARD DRIVE 04185, put in column B, for each specific cell of the same line you found the words 500GB HARD DRIVE 04185 on, a random number between 50 and 60.

    Line 3. If you find, in column A, the words OPTIC CABLE FIBER MC, put in column B, for each specific cell of the same line you found the words OPTIC CABLE FIBER MC on, a random number between 150 and 200.


    And so on.

    Once I have the body, I'll be able to change/copy it to fit my needs.

    For C's, if I was to explain it to my excel program, this is how I'd do it, line by line:

    Line 1. If you find, in column A, the words HARD DRIVE, put in column C, for each specific cell of the same line you found the words HARD DRIVE in, the letters HDD. (as in, you found HARD DRIVE in A10, put HDD in C10)

    Line 1. If you find, in column A, the words HDMI, put in column C, for the each specific cell of the same line you found the words HDMI in, the letters HDMI.


    I hope it makes more sense.
    Last edited by Eddie Lives On; 01-10-2011 at 05:08 PM.

  8. #8
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    OK, yes, I think we're finally there! Will come back tomorrow.

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    Basically you need a couple of look up tables for cols B and C - I have added something on second sheet of attachment.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    I can't try it for now (security issues when I try to use macros), but from what I was able to see, it looks great!
    ______________________________

    Now, what if I have more than just those 2 categories? I have a number of categories and the item names I will have to change will vary on a monthly basis. Also, If I would like to have some item's quantities to have a randomized number between what ever number I'd like (for some I might want between 50 & 60, some others between 20 and 30), what can I do for that? I don't see any item names anywhere so how can I search for a specific part of the item's name? I see that every item that has "Hard Drive" in it turns out as "HDD", same for HDMI and the quantities change for two specific products. Where can I add more items for the quantity changes, where can I define my parameters for "look for HARD DRIVE" and put HDD"? Also, those columns may move later (B will probably become G or H in a week or two as we're finalizing some details), how can I define that?

    If I could have 2 macros, one for quantities, one for that "HDD" category thing.

    I greatly appreciate your work and if I could remember the VBA course I had when I was a junior, it would probably help!


    Thanks a lot for your help, you're saving me at least 2 hours a week, probably more like 5 when I get some stuff figured out.
    Last edited by Eddie Lives On; 01-11-2011 at 10:39 AM. Reason: security issues fixed

  11. #11
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    It's in the tables in the second sheet - col B is the lower limit, col C the upper. Unless you can import it from somewhere else, you'll just have to add items to the tables manually. If there is any rule or logic to it you may be able to automate part of it but if changes to the list are arbitrary I don't think so.

  12. #12
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    I think I understand now... what you call look up table is in sheet 1.

    I love you!

    I'd still like 2 macros because in some of our lists, we don't have any quantities. I know I didn't mention that before but when I realised what I would be able to do, I knew I'd that macro at other places!

    Thanks a bunch

  13. #13
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    Run the macro and see what it does. If it's not in the list nothing is put in B and/or C.

  14. #14
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    Is there a way to do "Randomize, between 50 & 60, the quantity of X item if it's higher than 120"

    120 is a fictionnal number.

    Also, would there be a way to search "begins with" for let's the HDD thing?

    Thanks a lot, sir.

  15. #15
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    Hang on, I'm losing you again.

    For the HDD thing, one could use the LIKE operator, viz LIKE "HDD*" - do you mean it should look for "begins with" rather than "includes"?

  16. #16
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    Yes, begins with. We're changing stuff in our system so I'll have to change the nomenclature in a few days. I'll work my things around "begins with" so my items start with HARD DRIVE, or what ever I need.

    Thanks a lot.

  17. #17
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Changing values based on existing data

    Please Login or Register  to view this content.
    I didn't understand this:
    "Randomize, between 50 & 60, the quantity of X item if it's higher than 120"

  18. #18
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    I have some items in my inventory that are at let's say 200. I don't want people to know I have 200, I want to tell them I have between 110 and 125 for example. But if 3 customers come and buy 50 of that item each, I don't want the 50 remaining to be changed to 110-125. Since I don't look out for every item every day, the number of items in stock have to be changed if they're above a certain number. If it's higher than 125, then put a random number between 110 and 125 to replace that original number.

    Thanks Stephen
    Last edited by Eddie Lives On; 01-11-2011 at 12:52 PM. Reason: Typo

  19. #19
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    Bump!

    Still looking for "begins with" and "random number between X & Y if cell value > Z"

    Thanks everyone

  20. #20
    Registered User
    Join Date
    01-10-2011
    Location
    Canada
    MS-Off Ver
    Excel 2019
    Posts
    18

    Re: Changing values based on existing data

    Bump...

    I really need that macro. It's "half" done and I've already cut my work time in two. When it's fully done, It'll take me a quarter of the time it used to take me.


    Thanks a lot,

    Eddie

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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