This is my first post so if I break a forum rule please let me know! This question seemed to blur the line between the VBA forum and the Function forum, but I'm pretty positive my logic is right so the solution probably revolves around a VBA answer.
Here is a sample of code that works:
Range("D14").Select
Selection.FormulaArray = _
"=SUM(IF(Data!R2C5:R1472C5=R4C[-1],IF(Data!R2C9:R1472C9>=R15C1,IF(Data!R2C9:R1472C9<=R14C1,1,0),0),0))"
Range("D15").Select
Selection.FormulaArray = _
"=SUM(IF(Data!R2C10:R1472C10=0,IF(Data!R2C5:R1472C5=R4C[-1],IF(Data!R2C9:R1472C9>=R15C1,IF(Data!R2C9:R1472C9<=R14C1,1,0),0),0),0))"
Here is what I want to work but it is outputting incorrect data:
Range("D14").Select
Selection.FormulaArray = _
"=SUM(IF(OR(Data!R2C5:R1472C5=R4C[-1], Data!R2C5:R1472C5=R3C[-1]),IF(Data!R2C9:R1472C9>=R15C1,IF(Data!R2C9:R1472C9<=R14C1,1,0),0),0))"
Range("D15").Select
Selection.FormulaArray = _
"=SUM(IF(Data!R2C10:R1472C10=0,IF(OR(Data!R2C5:R1472C5=R4C[-1], Data!R2C5:R1472C5=R3C[-1]),IF(Data!R2C9:R1472C9>=R15C1,IF(Data!R2C9:R1472C9<=R14C1,1,0),0),0),0))"
In the sheet labeled Data, Column 5 is all names, Column 9 is all dates and Column 10 is all Integers. In the active sheet there is a name in both R4C[-1] and R3C[-1]. So to sum up the change, I want to check Data!C5 for 2 different names instead of just one and check if the date in Data!C9 is between the date range of R15C1 and R14C1. I tried the no brain way of just splitting the OR function into 2 different sums and that works, but only for the smaller formula since you can only send a cell 255 characters. I have an array full of these equations that are offset specific so I'm hoping to just tweek the above code, maybe something other than .FormulaArray that doesn't have a limitation, but I completely understand if you find a solution that completely dismantels it.
Bookmarks