Adding value to formula

Blake0920

Board Regular
Joined
Jan 2, 2022
Messages
60
Office Version
  1. 2016
Platform
  1. Windows
Trying to add R5:R7 to this formula. Essentially it will use the value of R to dictate which "Owing" column to put it in.

For example, Bob (P5) was on the 12 month payment plan so I would need that to populate in U14 whereas Mary (Q6) and Tom (Q7) are on the 6 and 9 mo payment plan so I would need those to populate in columns V14 and W14.

I tried adding the R value to the end of the formula but it keeps giving me an error. =SUMPRODUCT((MONTH(P14)<=T$5:T$7+1)*(MONTH(P14)>=MONTH(Q$5:Q$7))*(YEAR(P14)<=YEAR(W$5:W$7))*U$5:U$7)*(R5:R7="12")

How do I add the value of R so that it knowns which column to put it in?

Sales Orders 2022-2.1 - Blake with dates 2.0.xlsm
OPQRSTUVWXYZAAAB
3
4Name Cancel DateOG Mo PPOwing DurationMo. TotalCancel End Date
5Bob01-Feb-2212$863.338$107.9212022-10-01
6Mary02-Mar-226$573.213$191.0712022-06-02
7Tom03-Feb-229$1,023.0012$85.2512023-02-03
8
9
10
11
12
13Mo12 mo9 mo6 mo3 moOwing 12Owing 9Owing 6Owing 3Reduced 12Reduced 9Reduced 6Reduced 3
1422-Feb$31,492.43$2,386.30$3,995.42$4,040.97#SPILL!#SPILL!$2,386.30$3,995.42
1522-Mar$27,025.93$2,386.30$2,294.78$4,040.97$384.24$26,641.69$2,386.30$2,294.78
1622-Apr$24,164.54$2,386.30$1,084.99$1,863.78$384.24$23,780.31$2,386.30$1,084.99
1722-May$23,292.13$1,598.78$1,084.99$193.17$23,098.96$1,598.78$1,084.99
1822-Jun$20,192.76$1,360.44$1,084.99$193.17$19,999.59$1,360.44$1,084.99
1922-Jul$17,857.81$853.89$340.83$193.17$17,664.64$853.89$340.83
2022-Aug$15,584.18$243.89$193.17$15,391.01$243.89 
2122-Sep$13,762.83$243.89$193.17$13,569.66$243.89 
2222-Oct$11,715.20$85.25$11,629.95  
2322-Nov$9,562.18$85.25$9,476.93  
2422-Dec$5,771.53$85.25$5,686.28  
2523-Jan$1,095.00 $1,095.00 
2623-Feb  $193.17
2723-Mar$384.24
2823-Apr$384.24
2923-May$193.17
3023-Jun$193.17
3123-Jul$193.17
3223-Aug$193.17
3323-Sep$193.17
3423-Oct$85.25
3523-Nov$85.25
3623-Dec$85.25
PP Mo
Cell Formulas
RangeFormula
U5:U7U5=S5/T5
W5:W7W5=EDATE(Q5,T5)
T14T14=A38/M6+(A35/3)
T15T15=A38/M6+(A35/3)
T16T16=A38/M6
S14S14=B38/M7+(B35/6)+(B23/6)+(B26/6)
S15S15=B38/M7+(B35/6)+(B26/6)
S16S16=B38/M7+(B35/6)
S17S17=B38/M7+(B35/6)
S18S18=B38/M7+(B35/6)
S19S19=B38/M7
R14R14=C38/M8+(C35/9)+(C23/9)+(C26/9)+(C29/9)+(C20/9)
R15R15=C38/M8+(C35/9)+(C23/9)+(C26/9)+(C29/9)+(C20/9)
R16R16=C38/M8+(C35/9)+(C23/9)+(C26/9)+(C29/9)+(C20/9)
R17R17=C38/M8+(C35/9)+(C23/9)+(C26/9)+(C29/9)
R18R18=C38/M8+(C35/9)+(C26/9)+(C29/9)
R19R19=C38/M8+(C35/9)+(C29/9)
R20R20=C38/M8+(C35/9)
R21R21=C38/M8+(C35/9)
Z14:Z24,AA14:AA25,Y14:Y25Z14=R14-V14
Q14Q14=(D5/J5)/M9*(J5)+(D8/J8)/M9*(J8)+(D11/J11)/M9*(J11)+(D14/J14)/M9*(J14)+(D17/J17)/M9*(J17)+(D20/J20)/M9*(J20)+(D23/J23)/M9*(J23)+(D26/J26)/M9*(J26)+(D29/J29)/M9*(J29)+(D32/J32)/M9*(J32)+(D35/J35)/M9*(J35)+(D38/J38)/M9*(J38)
Q15Q15=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)+(D8/12)+(D11/12)+(D14/12)+(D17/12)+(D20/12)
Q16Q16=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)+(D11/12)+(D14/12)+(D17/12)+(D20/12)
Q17Q17=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)+(D14/12)+(D17/12)+(D20/12)
Q18Q18=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)+(D17/12)+(D20/12)
Q19Q19=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)+(D20/12)
Q20Q20=(D38/M9)+(D35/12)+(D23/12)+(D26/12)+(D29/12)+(D32/12)
Q21Q21=(D38/M9)+(D35/12)+(D26/12)+(D29/12)+(D32/12)
Q22Q22=(D38/M9)+(D35/12)+(D29/12)+(D32/12)
Q23Q23=(D38/M9)+(D35/12)+(D32/12)
Q24Q24=(D38/M9)+(D35/12)
Q25Q25=(D38/M9)
Q26Q26=(D41/M9)
T26T26=Q26-S26
U14U14=SUMPRODUCT((MONTH(P14)<=T$5:T$7+1)*(MONTH(P14)>=MONTH(Q$5:Q$7))*(YEAR(P14)<=YEAR(W$5:W$7))*U$5:U$7)*(R5:R7="12")
U15:U36U15=SUMPRODUCT((MONTH(P15)<=T$5:T$7+1)*(MONTH(P15)>=MONTH(Q$5:Q$7))*(YEAR(P15)<=YEAR(W$5:W$7))*U$5:U$7)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I was able the R field but cannot seem to get it to continue down the column. It is not hold its top value of R5.

You will see the values in Y5:Y10


Sales Orders 2022-2.1 - Blake with dates 2.0dfgdfg.xlsm
OPQRSTUVWXYZ
3
4Name Cancel DateOG Mo PPOwing DurationMo. TotalCancel End Date
5 107.91625
6Bob01-Feb-2212M$863.338$107.9212022-10-01 
7Mary02-Feb-226M$573.213$191.0712022-05-02 
8Tom03-Feb-229M$1,023.0012$85.2512023-02-03 
9  
10
PP Mo
Cell Formulas
RangeFormula
U6:U8U6=S6/T6
W5:W9W5=EDATE(Q5,T5)
Y5:Y9Y5=SUMPRODUCT((MONTH(P16)<=T$5:T$9+1)*((R5:R9)="12M")*(MONTH(P16)>=MONTH(Q$5:Q$9))*(YEAR(P16)<=YEAR(W$5:W$9))*U$5:U$9)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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