Hi, I have a large dataset, about 4000 rows, which I need to correct some values in case of a criteria. Below is the example of my data:
Order ID | Product Type | Dollar Amount |
11 | Low grade | 20 |
11 | Premium | 35 |
11 | Low grade | 10 |
12 | Premium | 50 |
12 | Premium | 20 |
12 | Low grade | 10 |
12 | Low grade | 40 |
12 | Low grade | 45 |
12 | Premium | 30 |
In each of distinct order IDs, the dollar amount of premium products must be higher than low grade ones. As seen in my data, for order ID “11”, there is no issue since premium one is larger than low grade ones: 35>20>10.
But in order ID “12”, as it is seen, there are two low grade orders which have higher dollar values than two of the premium ones. To fix this issue, I must swap the value of the low grade ones (40,45) with the premium ones (20,30). So, after correction, the data should look like the following:
Order ID | Product Type | Dollar Amount |
11 | Low grade | 20 |
11 | Premium | 35 |
11 | Low grade | 10 |
12 | Premium | 50 |
12 | Premium | 40 |
12 | Low grade | 10 |
12 | Low grade | 20 |
12 | Low grade | 30 |
12 | Premium | 45 |
I have similar issues with many of the order IDs in my dataset which I need a VBA code to go through all the order IDs and fix this issue if exists.
By: Sam
Say, you got a nice post. Much obliged.
Please let me recognize if you’re trying to find a good author for your web site. You may have some great articles, and I think I might be a good advantage. Should you ever want to acquire some of the weight off, I’d like to be able to write some material intended for your blog in change to get a link back to be able to mine. Please shoot me personally an email if serious. Thanks.
I’ve book-marked your site, and Now i’m adding your The really simply syndication feeds to my Yahoo account.
Hey, thanks for the post.Much thanks again.
I simply desired to thank you therefore much again. I are not sure the issues that I would possess gone through without typically the form of hints revealed simply by you regarding that scenario.
Drug Treatment Near Me Residential Drug Treatment Programs ÿþ< Free Drug And Alcohol Treatment Centers Mens Rehab
ÿþh
Good post! Thanks!
Being around you makes everything better.
Samhsa Treatment Drug And Alcohol Rehabilitation Centers Near Me ÿþ< Alcohol Rehab Clinic Alcohol Clinic
ÿþh
There is totally a lot to locate out nearly this subject. I love all of the points you ave made.