I'm a courier. I have an excel invoice. Each job is listed on this invoice from the top down with columns named DATE, CUSTOMER, JOB #, PICK UP / DEL LOCATION, DISTANCE, SUBTOTAL, JOB TOTAL.
If a job has no special expenses or charges tied to it, then it only takes up one row. If there are special charges, I use the next 1 to 3 rows to list those. I start by highlighting the first 3 columns of the next 1 to 3 rows (DATE, CUSTOMER, JOB #), selecting Merge & Center, entering "ADDITIONAL CHARGES >>>" in the newly merged block of cells and beginning below the "PICK UP / DEL LOCATION" column(to the right of newly merged block, I list the additional charges, however many there may be. They could be any of the following. Weight, Wait Time, After Hours, Weekend, Holiday, and Extra Stop.
I already have a formula that searches for these words, extracts the number behind such a word and calculates a subtotal based on these values. (shown below) I now need a formula that can add the subtotal of each job and populate the JOB TOTAL column, no matter how many rows of additional charges there are below a particular job, and without mistakenly counting subtotals of the next job. Any help is greatly appreciated.
Formula for Subtotals:
{=IF(ISBLANK(D2),"",IF(ISNUMBER(SEARCH("WEIGHT",D2)),(0.05)*(1*MID(D2,MATCH(TRUE,ISNUMBER(1*MID(D2,ROW($1:$20),1)),0),COUNT(1*MID(D2,ROW($1:$20),1)))-100),IF(ISNUMBER(SEARCH("WAIT",D2)),(0.2)*(1*MID(D2,MATCH(TRUE,ISNUMBER(1*MID(D2,ROW($1:$20),1)),0),COUNT(1*MID(D2,ROW($1:$20),1)))-15),IF(D2="WEEKEND",6,(IF(D2="AFTER HOURS",3,(IF(D2="HOLIDAY",12,IF(D2="EXTRA STOP",6,IF(E2="LOCAL",15,(E2*0.9)))))))))))}
If a job has no special expenses or charges tied to it, then it only takes up one row. If there are special charges, I use the next 1 to 3 rows to list those. I start by highlighting the first 3 columns of the next 1 to 3 rows (DATE, CUSTOMER, JOB #), selecting Merge & Center, entering "ADDITIONAL CHARGES >>>" in the newly merged block of cells and beginning below the "PICK UP / DEL LOCATION" column(to the right of newly merged block, I list the additional charges, however many there may be. They could be any of the following. Weight, Wait Time, After Hours, Weekend, Holiday, and Extra Stop.
I already have a formula that searches for these words, extracts the number behind such a word and calculates a subtotal based on these values. (shown below) I now need a formula that can add the subtotal of each job and populate the JOB TOTAL column, no matter how many rows of additional charges there are below a particular job, and without mistakenly counting subtotals of the next job. Any help is greatly appreciated.
Formula for Subtotals:
{=IF(ISBLANK(D2),"",IF(ISNUMBER(SEARCH("WEIGHT",D2)),(0.05)*(1*MID(D2,MATCH(TRUE,ISNUMBER(1*MID(D2,ROW($1:$20),1)),0),COUNT(1*MID(D2,ROW($1:$20),1)))-100),IF(ISNUMBER(SEARCH("WAIT",D2)),(0.2)*(1*MID(D2,MATCH(TRUE,ISNUMBER(1*MID(D2,ROW($1:$20),1)),0),COUNT(1*MID(D2,ROW($1:$20),1)))-15),IF(D2="WEEKEND",6,(IF(D2="AFTER HOURS",3,(IF(D2="HOLIDAY",12,IF(D2="EXTRA STOP",6,IF(E2="LOCAL",15,(E2*0.9)))))))))))}