excel - Forcing SUMPRODUCT to ignore text values -


I have a list list from which I want to remove a certain value. The dates in the table are as headers, and each cell in the first column shows a different product type. Using the SUMPRODUCT formula as shown below instead of HLOOKUP , I would like to get the amount of units available for a specific product.

My problem is that I do not know in advance how many columns will be required, because I am importing the number of units for every product every month. Therefore, I have to use whole lines instead of cell names in the form shown in the formula given below.

However, the line headers in line 1: 5 include the data along with the result and #VALUE! Error

How to ignore the text values ​​of SUMPRODUCT A.: Calculate the remaining cells by placing rows in the form of rows instead of cell names?

Formula:

  = SUMPRODUCT (- ("Product 1" = $ A $ 2: $ A $ 4) * - (DATE (YEAR (today ()) , Month (today () ()), 1) = 1: 1) * (2: 4))  

returns #VALUE! (For October 1, 2014, the product should be considered 750.)

The formula given below returns the right result, but for this I know the size of the front of the limit, so No good:

  = SUMPRODUCT (- ("Product 1" = $ A $ 2: $ A $ 4) * - (DATE (YEAR (TODAY ()), MONTH (TODAY ( )), 1) = B1: E1) * (B2: E4))   

< P> If you have your mix headers with your data then you are going to make your life very complex

one thing that you can do instead May include make big enough for your limitations so do not worry about uprooting them. For example, extend horizontally to the last possible column in Sheet ( XFD ):

  = SUMPRODUCT (- ("Product 1" = $ A $ 2: $ A $ 4) * - (DATE (YEAR (TODAY)), MONTH (TODAY ()), 1) = B1: XFD1) * (B2: XFD4))  

It can do anything like this if you do not know ahead of time how many products will you have - extend up to 1,000 or 100,000 lines or whatever you know will cover your worst situation (1,048,756 More can not be done)

One other thing : You are effectively using SUMPRODUCT to emulate the behavior of INDEX and MATCH . These are actually the tasks used for such tasks. ()

  = INDEX ($ B $ 2: $ E $ 4, MATCH ("Product 1", $ A $ 2: $ A $ 4,0), MATCH (DATE (YEAR) (TODAY), MONTH (TODAY ()), 1), $ B $ 1: $ E $ 1,0))  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -