Need help with Excel formula to find a group of data and return a value in that data set.

JadeWitte

New Member
Joined
Jun 27, 2012
Messages
6
I have a fairly large spreadsheet with about 5,000 lines and 100+ columns. I've taken a small piece of it and posted below to give you the layout of the spreadsheet. Row 2 is a number assigned to each month over the next 10 years.

What I'm trying to do is write a formula that will look specifically at a column (in this example Column E). I want the formula to scroll down to the first instance of a headcount for all particular grouping (which in the example below, the grouping are separated by the headcount rows). If it is the first time headcount has been introduced for the grouping then the formula will determine which group and the "PGM" amount. In the example below, for column E, The grouping in which there is new headcount added is in row 22 (specifically the trigger is the value in E22, since there is 0 or "" in cell D22). Once I determine the grouping then I need the PGM value which in this example is cell: E28.

I tried doing an HLOOKUP nested within a VLOOKUP, but the problem was it created a circular reference (since certain cells were in each other's arrays). I created a massive IF statement that DID work, but it is extremely cumbersome, and probably not the way to do it. My IF statement basically went down Columns D & E and looked at Rows 4, 13,22, 31...etc. etc..all the way down...until I had this massive formula that nearly maxed out the number of characters for a formula (8,150 characters I think). In my IF statement if Column D was blank AND Column E was greater than 1, then I would request value in E28 in this example below. Is there way to do this without a massive, clumsy nested IF statement? Thank you for your assistance!!!


[TABLE="width: 775"]
<tbody>[TR]
[TD]A[/TD]
[TD="align: center"]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD]Mar[/TD]
[TD]Apr[/TD]
[TD]May[/TD]
[TD]Jun[/TD]
[TD]Jul[/TD]
[TD]Aug[/TD]
[TD]Sep[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD]32[/TD]
[TD]33[/TD]
[TD]34[/TD]
[TD]35[/TD]
[TD]36[/TD]
[TD]37[/TD]
[TD]38[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Headcount[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Revenue[/TD]
[TD]16,200[/TD]
[TD]16,200[/TD]
[TD]16,200[/TD]
[TD]24,300[/TD]
[TD]24,300[/TD]
[TD]24,300[/TD]
[TD]32,400[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Direct Cost[/TD]
[TD]12,085[/TD]
[TD]12,085[/TD]
[TD]12,085[/TD]
[TD]18,128[/TD]
[TD]18,128[/TD]
[TD]18,128[/TD]
[TD]24,170[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]DPM[/TD]
[TD]4,115[/TD]
[TD]4,115[/TD]
[TD]4,115[/TD]
[TD]6,172[/TD]
[TD]6,172[/TD]
[TD]6,172[/TD]
[TD]8,230[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]%DPM[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Indirect Cost[/TD]
[TD]486[/TD]
[TD]486[/TD]
[TD]486[/TD]
[TD]729[/TD]
[TD]729[/TD]
[TD]729[/TD]
[TD]972[/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]PGM[/TD]
[TD]3,629[/TD]
[TD]3,629[/TD]
[TD]3,629[/TD]
[TD]5,443[/TD]
[TD]5,443[/TD]
[TD]5,443[/TD]
[TD]7,258[/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]%PGM[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[/TR]
[TR]
[TD]12[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]Headcount[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD]Revenue[/TD]
[TD]0[/TD]
[TD]15,400[/TD]
[TD]15,400[/TD]
[TD]23,100[/TD]
[TD]23,100[/TD]
[TD]23,100[/TD]
[TD]30,800[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD]Direct Cost[/TD]
[TD]0[/TD]
[TD]11,488[/TD]
[TD]11,488[/TD]
[TD]17,233[/TD]
[TD]17,233[/TD]
[TD]17,233[/TD]
[TD]22,977[/TD]
[/TR]
[TR]
[TD]16[/TD]
[TD]DPM[/TD]
[TD]0[/TD]
[TD]3,912[/TD]
[TD]3,912[/TD]
[TD]5,867[/TD]
[TD]5,867[/TD]
[TD]5,867[/TD]
[TD]7,823[/TD]
[/TR]
[TR]
[TD]17[/TD]
[TD]%DPM[/TD]
[TD][/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[/TR]
[TR]
[TD]18[/TD]
[TD]Indirect Cost[/TD]
[TD]0[/TD]
[TD]462[/TD]
[TD]462[/TD]
[TD]693[/TD]
[TD]693[/TD]
[TD]693[/TD]
[TD]924[/TD]
[/TR]
[TR]
[TD]19[/TD]
[TD]PGM[/TD]
[TD]0[/TD]
[TD]3,450[/TD]
[TD]3,450[/TD]
[TD]5,174[/TD]
[TD]5,174[/TD]
[TD]5,174[/TD]
[TD]6,899[/TD]
[/TR]
[TR]
[TD]20[/TD]
[TD]%PGM[/TD]
[TD][/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]Headcount[/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]3[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]23[/TD]
[TD]Revenue[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]15,400[/TD]
[TD]15,400[/TD]
[TD]23,100[/TD]
[TD]23,100[/TD]
[TD]23,100[/TD]
[/TR]
[TR]
[TD]24[/TD]
[TD]Direct Cost[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]11,488[/TD]
[TD]11,488[/TD]
[TD]17,233[/TD]
[TD]17,233[/TD]
[TD]17,233[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]DPM[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]3,912[/TD]
[TD]3,912[/TD]
[TD]5,867[/TD]
[TD]5,867[/TD]
[TD]5,867[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]%DPM[/TD]
[TD][/TD]
[TD][/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[/TR]
[TR]
[TD]27[/TD]
[TD]Indirect Cost[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]462[/TD]
[TD]462[/TD]
[TD]693[/TD]
[TD]693[/TD]
[TD]693[/TD]
[/TR]
[TR]
[TD]28[/TD]
[TD]PGM[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]3,450[/TD]
[TD]3,450[/TD]
[TD]5,174[/TD]
[TD]5,174[/TD]
[TD]5,174[/TD]
[/TR]
[TR]
[TD]29[/TD]
[TD]%PGM[/TD]
[TD][/TD]
[TD][/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[/TR]
[TR]
[TD]30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]31[/TD]
[TD]Headcount[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]Revenue[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]16,200[/TD]
[TD]16,200[/TD]
[TD]16,200[/TD]
[TD]24,300[/TD]
[/TR]
[TR]
[TD]33[/TD]
[TD]Direct Cost[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12,085[/TD]
[TD]12,085[/TD]
[TD]12,085[/TD]
[TD]18,128[/TD]
[/TR]
[TR]
[TD]34[/TD]
[TD]DPM[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]4,115[/TD]
[TD]4,115[/TD]
[TD]4,115[/TD]
[TD]6,172[/TD]
[/TR]
[TR]
[TD]35[/TD]
[TD]%DPM[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[TD]25.40%[/TD]
[/TR]
[TR]
[TD]36[/TD]
[TD]Indirect Cost[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]486[/TD]
[TD]486[/TD]
[TD]486[/TD]
[TD]729[/TD]
[/TR]
[TR]
[TD]37[/TD]
[TD]PGM[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]3,629[/TD]
[TD]3,629[/TD]
[TD]3,629[/TD]
[TD]5,443[/TD]
[/TR]
[TR]
[TD]38[/TD]
[TD]%PGM[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[TD]22.40%[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I have a fairly large spreadsheet with about 5,000 lines and 100+ columns. I've taken a small piece of it and posted below to give you the layout of the spreadsheet. Row 2 is a number assigned to each month over the next 10 years.

What I'm trying to do is write a formula that will look specifically at a column (in this example Column E). I want the formula to scroll down to the first instance of a headcount for all particular grouping (which in the example below, the grouping are separated by the headcount rows). If it is the first time headcount has been introduced for the grouping then the formula will determine which group and the "PGM" amount. In the example below, for column E, The grouping in which there is new headcount added is in row 22 (specifically the trigger is the value in E22, since there is 0 or "" in cell D22). Once I determine the grouping then I need the PGM value which in this example is cell: E28.

I tried doing an HLOOKUP nested within a VLOOKUP, but the problem was it created a circular reference (since certain cells were in each other's arrays). I created a massive IF statement that DID work, but it is extremely cumbersome, and probably not the way to do it. My IF statement basically went down Columns D & E and looked at Rows 4, 13,22, 31...etc. etc..all the way down...until I had this massive formula that nearly maxed out the number of characters for a formula (8,150 characters I think). In my IF statement if Column D was blank AND Column E was greater than 1, then I would request value in E28 in this example below. Is there way to do this without a massive, clumsy nested IF statement? Thank you for your assistance!!!


[TABLE="width: 775"]
<TBODY>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]Mar
[/TD]
[TD]Apr
[/TD]
[TD]May
[/TD]
[TD]Jun
[/TD]
[TD]Jul
[/TD]
[TD]Aug
[/TD]
[TD]Sep
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD][/TD]
[TD]32
[/TD]
[TD]33
[/TD]
[TD]34
[/TD]
[TD]35
[/TD]
[TD]36
[/TD]
[TD]37
[/TD]
[TD]38
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]Headcount
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]Revenue
[/TD]
[TD]16,200
[/TD]
[TD]16,200
[/TD]
[TD]16,200
[/TD]
[TD]24,300
[/TD]
[TD]24,300
[/TD]
[TD]24,300
[/TD]
[TD]32,400
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]Direct Cost
[/TD]
[TD]12,085
[/TD]
[TD]12,085
[/TD]
[TD]12,085
[/TD]
[TD]18,128
[/TD]
[TD]18,128
[/TD]
[TD]18,128
[/TD]
[TD]24,170
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]DPM
[/TD]
[TD]4,115
[/TD]
[TD]4,115
[/TD]
[TD]4,115
[/TD]
[TD]6,172
[/TD]
[TD]6,172
[/TD]
[TD]6,172
[/TD]
[TD]8,230
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]%DPM
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]Indirect Cost
[/TD]
[TD]486
[/TD]
[TD]486
[/TD]
[TD]486
[/TD]
[TD]729
[/TD]
[TD]729
[/TD]
[TD]729
[/TD]
[TD]972
[/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]PGM
[/TD]
[TD]3,629
[/TD]
[TD]3,629
[/TD]
[TD]3,629
[/TD]
[TD]5,443
[/TD]
[TD]5,443
[/TD]
[TD]5,443
[/TD]
[TD]7,258
[/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD]%PGM
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13
[/TD]
[TD]Headcount
[/TD]
[TD][/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]14
[/TD]
[TD]Revenue
[/TD]
[TD][/TD]
[TD]15,400
[/TD]
[TD]15,400
[/TD]
[TD]23,100
[/TD]
[TD]23,100
[/TD]
[TD]23,100
[/TD]
[TD]30,800
[/TD]
[/TR]
[TR]
[TD]15
[/TD]
[TD]Direct Cost
[/TD]
[TD][/TD]
[TD]11,488
[/TD]
[TD]11,488
[/TD]
[TD]17,233
[/TD]
[TD]17,233
[/TD]
[TD]17,233
[/TD]
[TD]22,977
[/TD]
[/TR]
[TR]
[TD]16
[/TD]
[TD]DPM
[/TD]
[TD][/TD]
[TD]3,912
[/TD]
[TD]3,912
[/TD]
[TD]5,867
[/TD]
[TD]5,867
[/TD]
[TD]5,867
[/TD]
[TD]7,823
[/TD]
[/TR]
[TR]
[TD]17
[/TD]
[TD]%DPM
[/TD]
[TD][/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[/TR]
[TR]
[TD]18
[/TD]
[TD]Indirect Cost
[/TD]
[TD][/TD]
[TD]462
[/TD]
[TD]462
[/TD]
[TD]693
[/TD]
[TD]693
[/TD]
[TD]693
[/TD]
[TD]924
[/TD]
[/TR]
[TR]
[TD]19
[/TD]
[TD]PGM
[/TD]
[TD][/TD]
[TD]3,450
[/TD]
[TD]3,450
[/TD]
[TD]5,174
[/TD]
[TD]5,174
[/TD]
[TD]5,174
[/TD]
[TD]6,899
[/TD]
[/TR]
[TR]
[TD]20
[/TD]
[TD]%PGM
[/TD]
[TD][/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[/TR]
[TR]
[TD]21
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]22
[/TD]
[TD]Headcount
[/TD]
[TD][/TD]
[TD][/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]23
[/TD]
[TD]Revenue
[/TD]
[TD][/TD]
[TD][/TD]
[TD]15,400
[/TD]
[TD]15,400
[/TD]
[TD]23,100
[/TD]
[TD]23,100
[/TD]
[TD]23,100
[/TD]
[/TR]
[TR]
[TD]24
[/TD]
[TD]Direct Cost
[/TD]
[TD][/TD]
[TD][/TD]
[TD]11,488
[/TD]
[TD]11,488
[/TD]
[TD]17,233
[/TD]
[TD]17,233
[/TD]
[TD]17,233
[/TD]
[/TR]
[TR]
[TD]25
[/TD]
[TD]DPM
[/TD]
[TD][/TD]
[TD][/TD]
[TD]3,912
[/TD]
[TD]3,912
[/TD]
[TD]5,867
[/TD]
[TD]5,867
[/TD]
[TD]5,867
[/TD]
[/TR]
[TR]
[TD]26
[/TD]
[TD]%DPM
[/TD]
[TD][/TD]
[TD][/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[/TR]
[TR]
[TD]27
[/TD]
[TD]Indirect Cost
[/TD]
[TD][/TD]
[TD][/TD]
[TD]462
[/TD]
[TD]462
[/TD]
[TD]693
[/TD]
[TD]693
[/TD]
[TD]693
[/TD]
[/TR]
[TR]
[TD]28
[/TD]
[TD]PGM
[/TD]
[TD][/TD]
[TD][/TD]
[TD]3,450
[/TD]
[TD]3,450
[/TD]
[TD]5,174
[/TD]
[TD]5,174
[/TD]
[TD]5,174
[/TD]
[/TR]
[TR]
[TD]29
[/TD]
[TD]%PGM
[/TD]
[TD][/TD]
[TD][/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[/TR]
[TR]
[TD]30
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]31
[/TD]
[TD]Headcount
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]2
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]32
[/TD]
[TD]Revenue
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]16,200
[/TD]
[TD]16,200
[/TD]
[TD]16,200
[/TD]
[TD]24,300
[/TD]
[/TR]
[TR]
[TD]33
[/TD]
[TD]Direct Cost
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]12,085
[/TD]
[TD]12,085
[/TD]
[TD]12,085
[/TD]
[TD]18,128
[/TD]
[/TR]
[TR]
[TD]34
[/TD]
[TD]DPM
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4,115
[/TD]
[TD]4,115
[/TD]
[TD]4,115
[/TD]
[TD]6,172
[/TD]
[/TR]
[TR]
[TD]35
[/TD]
[TD]%DPM
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[TD]25.40%
[/TD]
[/TR]
[TR]
[TD]36
[/TD]
[TD]Indirect Cost
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]486
[/TD]
[TD]486
[/TD]
[TD]486
[/TD]
[TD]729
[/TD]
[/TR]
[TR]
[TD]37
[/TD]
[TD]PGM
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3,629
[/TD]
[TD]3,629
[/TD]
[TD]3,629
[/TD]
[TD]5,443
[/TD]
[/TR]
[TR]
[TD]38
[/TD]
[TD]%PGM
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[TD]22.40%
[/TD]
[/TR]
</TBODY>[/TABLE]

So this will address the specific scenario you described, but something tells me it doesn't meet what ALL your needs really are. Perhaps you'll be able to modify it to meet what you really need.

=INDEX($E$1:$E$38,SUMPRODUCT(--($B$1:$B$38="HEADCOUNT")*--($C$1:$C$38="")*--($D$1:$D$38="")*--($E$1:$E$38>1)*A1:A38)+6,1)

Not sure where you need to have this formula place, but for column E:


1) It will look for which row has the heading headcount
2) identify where column C, and Column D = ""
3) identify where column E > 1

Once it has verified which row has headcount and a "" in column C and column D and column E is >1 it will return the row number from column A and add 6 since that is how many rows down PGM is from headcount.

The row number from above is passed into the INDEX function which uses that value to know which row number to pick returning the PGM value from COLUMN E.
 
Upvote 0
Thank you CMS, jr.!!! I've never used the SUMPRODUCT function, but will from now on! Really cool. So absolutely the formula will work the way you wrote it for the example I gave you, however, my example (the way I illustrated it) was not completely accurate. Column A is not a series of numbers 1 to 38, but rather me trying to number the rows for the sake of trying to depict Excel to help solve the problem. In other words Column A is where the data starts (or the column for "Headcount"). Having said that, I could insert a column at the beginning and easily add 1,2,3....all the way down and use your formula as is (modifying the column names, etc). But I would prefer not insert this number column at the front if not necessary...if there is a different way. I'm assuming the formula needs these numbers to know what number to add "6" to in order to get to the "PGM" number, so maybe I have to insert this column. I can always then "hide" it if it looks strange. Curious if there is a different way? Also, what does the "1" indicate at the very end of the formula? Thanks again!! I've spent countless hours trying to figure this out and you have really taught me something new that I'm excited to start leveraging!!!

Regards, Jade
 
Upvote 0
Thanks again. This formula works fairly well for me after doing some modifications as you indicated I might have to do. The challenge that I'm having is that I really need the $E$1:$E$38 array to be dynamic versus static. Here's why. I'm feeding numbers into this spreadsheet from another one. Based upon a VLOOKUP on that other spreadsheet I'm either adding +2, +1, 0, or -2 to the month identifiers on the spreadsheet above. Specifically in this example (34) under May. So let's say, my VLOOKUP on the other spreadsheet returns a (+1). I would add +1 to 34 and the month (column) I would want to use for the INDEX (SUMPRODUCT) formula above is 35 (or the Month of June). If the VLOOK came back with -2, I would subtract 2 from 34 and want the column 32 (or March). I would want to get the PGM number for the data group just like above but I want the column to be dynamic rather than hard-coded as is the case now. Can you or anyone else help me do this, please? I've been researching MATCH, INDEX, V & HLOOKUP functions all day and know that I'm close to getting it. Thank you!!!
 
Last edited:
Upvote 0
Sorry I didn't respond, had to focus on work today. Take a look at using the OFFSET function. It always you to move ranges or position. So you could utilize the 1, -1, -2 returned from the VLOOKUP withing the OFFSET to know which column , E, F, Etc to be in.
 
Upvote 0
No worries...I've been going down the OFFSET path this afternoon but not sure how to construct the formula exactly. I should hopefully figure it out tonight. But, I'm with you, I think OFFSET is the way to go potentially. Thanks for responding.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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