put value depending on last digit in unorganised list

dappy

Board Regular
Joined
Apr 23, 2018
Messages
124
Office Version
  1. 2013
Platform
  1. Windows
So i have this

corridor1 2
corridor2 2
corridor3 2
outilane4 2
outilane1 2
outilane3 2
outilane2 2

column A for corridor i have a count of 3 and outilane a count of 4. Column B i'm told that i must delete an amount with a value of what is to be left, in this case
i need to have 2 of corridor and 2 of outilane left.

so i need to put in column C a value of "leave" or "delete" but it depends on the last digit in each name. so for corridor i have 1,2 and 3 and for outilane
i have 1,2,3 and 4. for corridor i need to delete 1 but it must be corridor3. for outilane i have to delete 2 but it
must be 3 and 4, so the last in each. is this possible? or even understandable! its not possible to have the list organised according to last value I'm sorry to say.

Much thanks in advance

Carl
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
sorry, my description is junk. I'll start again

the character at the right of corridor and outilane could be anything. column B has the counts but unordered. Column c shows how many must be left. in this case corridor998 3 is deleted and outilane 4 and 3 are deleted.

corridor998 1 2
corridor998 2 2
corridor998 3 2
outilane231 3 2
outilane231 4 2
outilane231 2 2
outilane231 1 2

Hopefully that's clearer. apologies for the confusion
 
Upvote 0
How about
=IF(B2>C2,"Delete","Leave")
 
Upvote 0
no, its never going to be that easy :(
so it could be like this below.
I guess we would have to count each selection then we'd know how many to delete and then choose the highests value in colB?

corridor998 7 2
corridor998 8 2
corridor998 6 2
outilane231 5 2
outilane231 6 2
outilane231 4 2
outilane231 3 2
 
Upvote 0
How do you expect to get a working solution if you keep posting completely bogus data? ;)

Please use the XL2BB add-in to post some accurate data along with the expected results.
 
Upvote 0
yeah really sorry about that, glad my life isnt in as much a state as my descriptions.

hope this makes more sense to you than me!

Book25
ABCD
1cam occuranceid ID REQLeave/deleter
2corridor-198/camera-19871
3corridor-198/camera-19881
4corridor-200/camera-20091
5corridor-200/camera-20081
6corridor-202/camera-20252
7corridor-202/camera-20262
8corridor-202/camera-20242
9corridor-202/camera-20232
Sheet1
 
Upvote 0
Ok, how about
=IF(COUNTIFS(A:A,A2,B:B,"<"&B2)<C2,"Leave","Delete")
 
Upvote 0
that is superb! thank you so much again!

although can i add just one caviat?

that works with values but not with cells that have formulas in. is there a =value of or something i can use?
 
Upvote 0
It does work for cells with formulae, as long as the formula is returning a number & not text.
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,803
Members
449,048
Latest member
greyangel23

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