excel - Sorting data by range of numbers -
i recieve table of data sorted purchase order po number in asc. further analysis of data, i'm supposed sort out business directions (sectors or departments e.g.). there range of order numbers, each of them related particular direction, 1000-1999 direction a, 2000-2999 direction b. ideally, need them automatically sorted in ascending order additional sum row underneath , direction name above. problem is, quantity of digits in number not limited, means orders might added 1 digit aside, or slash , letter, 2000/a, or 20,000 - , last 1 supposed in range of 2000-2999 pos.
what might used solve problem?
i'm not solve problem. fucntion successively shrink string right until number. can enter function vba module , use in spreadsheet.
function getnumber(s string) integer dim integer = len(s) 0 step -1 if isnumeric(left(s, i)) getnumber = left(s, i) = 0 end if next end function
if works, i'm glad. if doesn't, you'll need clarify you're looking for.
the biggest thing suggest redefining input make less tedious.
Comments
Post a Comment