SUM multiple rows when criteria is met and Match a specific column

=IFNA(SUM(VLOOKUP($A4,Consol!$C$8:$BS$222,MATCH(TB!G$1,Consol!$C$2:$BS$2,0),FALSE)),0) 

I have a project finance model (PFM) by month and I need the data to feed into a TB (also monthly). So what I need to do is sum multiple rows in the PFM that meet the criteria of being part of a specific GL code and I need the formula to pull the data when the date matches i.e in the TB for GL code 200 in JAN 19 I need it to find JAN 19 in the PFM and then sum all the rows that have been designated as GL code 200.

Image 1 is the TB

Image 2 is the PFM

5

1 Answer

=IFERROR(SUMIF(Consol!$C$10:$C$147,TB!$A12,INDEX(Consol!$K$10:$CX$147,,MATCH(TB!J$1,Consol!$K$2:$CX$2,0))),0)

Where:

  1. Consol!$C$10:$C$147 are the GL codes on the PFM model

  2. TB!$A12 is the specific GL code on the TB

  3. Consol!$K$10:$CX$147 is all of the relevant summing data in the PFM

  4. TB!J$1 is the Date on the TB model

  5. Consol!$K$2:$CX$2 are all the dates on the PFM

So the solution sums all matches that return the same GL code using SUMIF and then find the correct column to Sum using a combination of MATCH and INDEX

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like