Formula to delete selection of data if cell is certain value

rogerj99

New Member
Joined
Apr 11, 2012
Messages
3
I have a list of product transactions on sheet 1 (over 17000) listed by product code.

On sheet two i have a VLookup formula that looks up the value of the product code i enter into a cell, and returns the first transaction type for that product code. (Either 'AI' for adjustment in, or 'GO' for goods out).

I need the number of each product sold before we did a stock take. If the first transaction was a AI it means that it was stock taken before we sold any, if the first transaction was GO it means we sold some before it had been stock taken, and needs to be added back into the system.

So if the first reading on a product code was an AI, all transactions for that code can be deleted, if the first transaction was a GO I need to count how many we sold before the AI, and input back into stock.

Is there any way i can enter a product code, and if the first reading (as shown by the Vlookup) is equal to AI then all records of that product code are deleted?


There are over 3000 products and I really dont want to have to go through each one manually. Maybe I'm going to have to, just thought i'd give it a go here first before I did.

Got a file a can attach, but not sure how?

All help would be greatly appreciated.

Rogerj99
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You can't actually modify an original set of data or delete information with a formula. You will probably need VBA to do this.

You also can't attach files to this forum. You would need to upload it to somewhere like MS SkyDrive, Box.Net or Dropbox.

Dom
 
Upvote 0
Personally I don't contribute there any more.

Two points:

1 - People have to join that forum to view the file
2 - Please see point 2 of the guidelines for posting which is also against the rules of the other forum

Dom
 
Last edited:
Upvote 0
No offence, I was just pointing out the posting rules you agreed to on joining both forums.

If I get a chance later I will have a look at this.

Dom
 
Upvote 0

Forum statistics

Threads
1,216,355
Messages
6,130,155
Members
449,561
Latest member
Ivan1297

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top