Looking for a Solution (Conditional Array?) - Please Assist

hrvat2

New Member
Joined
Feb 8, 2016
Messages
5
Hi.

I "need" to write a function that will populate Col. G values by doing the following:

(Note: Data Set 1 spans columns "A" thru "F", Data Set 2 spans columns "J" thru "O"....below is just a small sample of either)

1) For a given row in column "B", look-up matching values in column "O" and return a sum of corresponding column "K" values (related, Data Set 2);
2) Then multiply the result of the above by the ratio of matching cell's Col. "F" value to that of all relevant Col. "F" values in Data set 1 (essentially pro-rate the above derived total based on Col. "F" values.)

By way of example, the first two rows of Col. "B" (Data Set 1) have a value of "1". Accordingly, Data Set 2,
Col. "O" matching rows (those also containing value of "1") are 1 & 18...and their corresponding values in related Col. "K" are 17.43 for both cells, which sums to 34.86.

Next, the function needs to appropriate that value of 34.86 among Data Set 1 matching (Col. "B" value) rows as based on their Col. "F" ("'Original Duration(h)") values...which in this instance are 6 & 6 respectively (see cells F1 and F2) hence the result for each of these two rows in 17.43 [or (34.86/(6/12))]

Note that Columns "B" and "O" are actually formatted as TEXT (despite their numerical appearance.)

My attempt to get this to work currently looks like this:

=IF(AND(ISNUMBER(SEARCH(B1,O1,1)),MID(O1,FIND(B1,O1)+1,1)<>"."),(SUMIF($O$1:$O$31,B1,$K$1:$K$31)*(F72/SUMIF($B$1:$B$32,B1,$F$1:$F$32))),"")

a) since the two column over which the initial match is performed are text, I am trying to find a sub-string (Col. "B" value) within a text string (Col. "O" value). ISNUMBER(SEARCH()) portion should return a number if there is a match;
b) Since e.g. a value of "4" from Col. "B" matches up with both a "4" and a "4.5" from Col. "O", a second logical test is added via AND(), this test being MID() which confirms that the succeeding text character is not a ".";
c) If the above two conditions are satisfied, simple SUMIF()'s are used to take care of the math.

The above approach does not work, hence this post. I am inclined to think this needs be an array formula (the AND() logical tests operate on a single cell reference context, seems like that might be the issue?) whereas the SUMIFs take an array as their argument). IF anyone can point me in the right direction, I would greatly appreciate it, a huge THANK YOU in advance!!!


THE DATA SET:


Col. ACol. BCol. CCol. DCol. ECol. FCol. GCol. HCol. ICol. JCol. KCol. LCol. MCol. NCol. O
Activity NameSort(*)WBS NameBuildingFloorOriginal Duration(h)HrsDescriptionTotal Labor HrsBldgAreaSub Area
DATA SET 1DATA SET 2
Electrical Demo/Remove1Interior Demolition/Removal (Smith 2nd)Smith2617.43213DEMO17.43Smith2Corridor1
Electrical Riser(s) Demo/Remove1Interior Demolition/Removal (Smith 2nd)Smith2617.43213TEMPORARY17.43Smith2Corridor2
Temporary Power & Lighting2Renovation (Smith 2nd)Smith2682.80264CEILING ROUGH IN POWER65.37Smith2Corridor4&5
Wall Cut-Ins for Electric at Demising Walls3Residents Rooms (Smith 2nd)Smith2425.8253814.81%CEILING ROUGH IN DATA65.37Smith2Corridor4&5
Fire Alarm Risers3Residents Rooms (Smith 2nd)Smith2212.912697.41%CABLE TRAY21.79Smith2Corridor4.5&5.5
Electrical Risers3Residents Rooms (Smith 2nd)Smith2425.8253814.81%WALL ROUGH65.37Smith2Corridor4&5
Data/Comm. Risers3Residents Rooms (Smith 2nd)Smith2212.912697.41%FIXTURES, DEVICES, CONTROLSSmith2Corridor
Electrical R.I. (Wall & Ceiling)3Residents Rooms (Smith 2nd)Smith2532.2817318.52%FIXTURES, DEVICES, CONTROLS43.58Smith2Corridor4.5&5.5
Fire Alarm R.I. (Wall & Ceiling)3Residents Rooms (Smith 2nd)Smith2532.2817318.52%TECH RM - RACKS/LADDER TRAY108.95Smith2Corridor4.5&5.5
Data/Comm. R.I. (Wall & Ceiling)3Residents Rooms (Smith 2nd)Smith2532.2817318.52%EQUIPMENT43.58Smith2Corridor4&4.5&5&5.5
Electrical R.I. Inspection @ Ext. Wall0Residents Rooms (Smith 2nd)Smith21FALSEFIRE ALARM/SECURITY/RADIO/ICOMM32.69Smith2Corridor4&4.5&5&5.5
Pull Wire (Power/Data/Comm./F.A./Temp. Control/Etc.)3.5Residents Rooms (Smith 2nd)Smith22048.74117PHONE /DATA21.79Smith2Corridor4&4.5&5&5.5
Light Fixtures3.5Residents Rooms (Smith 2nd)Smith2512.18529CATV43.58Smith2Corridor4&4.5&5&5.5
Devices (Power/Data/Comm./Etc.)3.5Residents Rooms (Smith 2nd)Smith2512.18529PULL WIRE /TERMINATE43.58Smith2Corridor4.5&5.5
Electrical Testing3.5Residents Rooms (Smith 2nd)Smith237.311175FIRE STOP6.54Smith2Corridor4&4.5&5&5.5
Fire Alarm Devices3.5Residents Rooms (Smith 2nd)Smith2512.18529PRETEST AND FA TESTINGSmith2Corridor4.5&5.5
Wall Cut-Ins for Electric at Demising Walls4Core/Corridors (Smith 2nd)Smith240SMITH 2R17.43Smith2Residential3&3.5
Fire Alarm Risers4Core/Corridors (Smith 2nd)Smith220DEMO17.43Smith2Residential1
Electrical Risers4Core/Corridors (Smith 2nd)Smith240TEMPORARY65.37Smith2Residential2
Data/Comm. Risers4Core/Corridors (Smith 2nd)Smith220CEILING ROUGH IN POWER65.37Smith2Residential3
Electrical R.I. (Wall & Ceiling)4Core/Corridors (Smith 2nd)Smith250CEILING ROUGH IN DATA65.37Smith2Residential3
Fire Alarm R.I. (Wall & Ceiling)4Core/Corridors (Smith 2nd)Smith250WALL ROUGH43.58Smith2Residential3
Data/Comm. R.I. (Wall & Ceiling)4Core/Corridors (Smith 2nd)Smith250FIXTURES, DEVICES, CONTROLSSmith2Residential
Electrical R.I. Inspection @ Ext. Wall0Core/Corridors (Smith 2nd)Smith21FALSEFIXTURES, DEVICES, CONTROLS43.58Smith2Residential3.5
Pull Wire (Power/Data/Comm./F.A./Temp. Control/Etc.)4.5Core/Corridors (Smith 2nd)Smith2150FIRE ALARM/SECURITY/RADIO/ICOMM32.69Smith2Residential3&3.5
Light Fixtures4.5Core/Corridors (Smith 2nd)Smith250PHONE /DATA10.90Smith2Residential3&3.5
Electric Panels4.5Core/Corridors (Smith 2nd)Smith220CATV65.37Smith2Residential3&3.5
Ladder Racks4.5Core/Corridors (Smith 2nd)Smith220PULL WIRE /TERMINATE43.58Smith2Residential3.5
Fire Alarm Panels4.5Core/Corridors (Smith 2nd)Smith220FIRE STOP6.54Smith2Residential3&3.5
Terminations4.5Core/Corridors (Smith 2nd)Smith2100DATA TESTING4.36Smith2Residential3.5
Technology Room Work4.5Core/Corridors (Smith 2nd)Smith250FA PRETEST1.09Smith2Residential3.5
Fire Alarm Devices5.5Bathrooms (Smith 2nd)Smith220

<tbody>
</tbody>
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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