I consolidate 2 reports into one workbook and have a 3rd sheet setup to hold all my functions. I am sure there is a macro that would do this all for me, but I don't know VBA.
The file uploaded has 3 sheets. The first 2 sheets are fairly accurate sample segments of the data I work with (minus sensitive details). If you look at sheet3, I've set it up to copy everything from sheet2 and the function I need help with is in column I. The function I was trying to create seems like it may not work and is not very efficient, so I am trying to go about it a different way.
I'm trying to find out if each vehicle is waiting for parts ("S") or waiting for maintenance ("M") by comparing the due in parts (column Q) with the ordered parts (column k:n). If the number in column Q is less than the number in column K:N, then it is waiting parts.
I think a better solution would be to sum up all the due in parts for one vehicle and match it to the sum of parts ordered and if there is a difference, then it is waiting parts. I think it would be some variation of:
=if(sum(offset( [sheet1 serial number reference], [range of cells blank between reference and next serial number in column A], [column Q between current vehicle and next vehicle] ))=sum(offset( [sheet1 serial number reference], [range of cells blank between reference and next serial number in column A],[column Q between current vehicle and next vehicle] )), "M", "S")
I'm thinking that looking for data in column A is the key here. I just don't know how to have excel start/stop an array between non-empty cells in column A and select only the range of numbers pertaining to that vehicle.
The file uploaded has 3 sheets. The first 2 sheets are fairly accurate sample segments of the data I work with (minus sensitive details). If you look at sheet3, I've set it up to copy everything from sheet2 and the function I need help with is in column I. The function I was trying to create seems like it may not work and is not very efficient, so I am trying to go about it a different way.
I'm trying to find out if each vehicle is waiting for parts ("S") or waiting for maintenance ("M") by comparing the due in parts (column Q) with the ordered parts (column k:n). If the number in column Q is less than the number in column K:N, then it is waiting parts.
I think a better solution would be to sum up all the due in parts for one vehicle and match it to the sum of parts ordered and if there is a difference, then it is waiting parts. I think it would be some variation of:
=if(sum(offset( [sheet1 serial number reference], [range of cells blank between reference and next serial number in column A], [column Q between current vehicle and next vehicle] ))=sum(offset( [sheet1 serial number reference], [range of cells blank between reference and next serial number in column A],[column Q between current vehicle and next vehicle] )), "M", "S")
I'm thinking that looking for data in column A is the key here. I just don't know how to have excel start/stop an array between non-empty cells in column A and select only the range of numbers pertaining to that vehicle.