Forum Discussion

John Reynolds's avatar
John Reynolds
Copper Contributor
Mar 26, 2018

Excel Formula for comparing multiple items then subtracting

I am working on a spread sheet that has multiple items, dates, and I'm trying to figure out a way if numbers changed from one week to the next.  Example, In column A I have an item number, column B is a Date, and Column C is my qty.  From the week prior, Column F has the item, Column G has the date, and Column H has the qty. 

 

What I need to know is if the date and item number match, what is the difference week over week?  I have tried If then and can't get it to work.  Help or thoughts?

  • Matt Mickle's avatar
    Matt Mickle
    Bronze Contributor

    Maybe you should try using a setup like in the attached sample file.  You should be able to use something like this to solve your issue:

     

    Check for Match:

     

    =IF(AND(A2=F2,B2=G2),"Match","No Match")

     

    Difference if Match:

    =IF(J2="No Match", "",C2-H2)

     

    Formula Combination:

    =IF(IF(AND(A2=F2,B2=G2),"Match","No Match")="MATCH",C2-H2,"No Match")

     

    If my example file is way off base maybe you could provide an example file with a before and after example that shows what you have now and what you expect to see.

     

     

     

Resources