Refer to index value present in same row - excel

For a large series of numbers I would like to find out a certain moving average.
I want for example in T(750) the average of K2:K(index). This certain index can be found in the same row, in column B. So in Cell B750.
How can I do this?
Any help is much appreciated

Use INDEX():
=AVERAGE($K$2:INDEX($K:$K,B750))
Or to ensure no errors as #Jeeped suggested
=AVERAGE($K$2:INDEX($K:$K,MAX(B750,2))
Otherwise you will get errors if B750 is text or null.

Related

Find the highest cell value in a row and return the adjacent cell value in Excel

I would like to find the max ProductBlendPercentage value in each row and return the associated ProductBlendMaterial value in column E.
I wrote this formula and although it works, it seems incorrect to me.
=INDEX(A2:D2,0,MATCH(MAX(B2,D2),B2:D2,0))
Is there a correct way to achieve my goal?
As per the comment section, all seems fine since you have a working formula. However I'd suggest a much simpler solution to your problem:
=IF(D2>B2,C2,A2)

What is the most optimal way to use ArrayFormula() to Count non-Blanks Where Column Header Matches Row Value?

What I'm attempting to do is count the number of blank cells across a dataset where the header of the row matches an array.
=countifs(D1:AZ,D2:AZ,D1:1,A2)
However, it appears that since the array sizes are different, it can't use it as a lookup.
Ideally, I'd be able to get an array formula to count the number of non-blank cells that correspond to each date in A2:A, like this:
Looking at the documentation for COUNTIFS, I don't see anything about it not being able to handle vertical and horizontal matching.
Also, I need to avoid using =query(), since there may be instances in D1:1 where a date is missing. I will be handling that with an iferror().
Any help/advice you all could provide would be greatly appreciated!
I have made an editable copy of the dataset here for reference.
Thanks
Try this. It is a matrix multiplication formula that sums up the nonblank cells for each column. It should work for you.
=arrayformula(mmult(transpose(if(D1:1="",0,if(isblank(D2:BG),0,1))),sign(ROW(D2:BG))))
I can explain it if you are interested.
EDIT: How about this? It adds a vlookup.
=arrayformula(iferror(vlookup(A2:A,{transpose(D1:1),mmult(transpose(if(D1:1="",0,if(isblank(D2:BF),0,1))),sign(ROW(D2:BF)))},2,false)))
This may be a way to do it, on B2:
=COUNTIFS(OFFSET($D$2:$D,,MATCH(A2,$D$1:$AZ$1,0)-1),">0")
Then you auto fill down, the idea is:
MATCH(A2,$D$1:$AZ$1,0) Will match each date on column A to the date on row 1 and return an index (from 1 to N).
OFFSET($D$2:$D,,N) Will take the range D2:D and offset N columns (In this case the output of MATCH).
Finally COUNTIFS will look for >0 values in the column which header matches the date on the left.
I hope it helps

How to use "COUNTIF" function to count one instance of something per row

I have a question I'm hoping someone in the community may be able to help me answer.
Here's my issue, I'm trying to use the COUNTIF function to determine how many times a particular value appears. Easy enough right? Here's the tricky part, I want to only count certain values from each row. Only retaining the count for a particular value from each row. Per row there should only be a max of (1) error type counted. Screenshot below for more context.
Example
Insert a helper column to track the highest priority error. In your helper column use the following formula and copy down as required. If you prefer a blank over the word none when no errors are found, change "None" to "".
=IFERROR("P"&AGGREGATE(15,6,RIGHT(E2:J2,1)/(E2:J2<>""),1),"None")
In my example below I place the helper column in column D, but it can be any column.
In D16:E16 I used the following formula and copied right
=COUNTIF($D$4:$D$13,E$15)

Adding based on text string in a cell in a table

So I have a table with description lines like this: EFT VISA RF#509723083734 04/07 ENDICIA POSTAGE (EMS) 650-321-2640.
What I'd like to be able to do is add up all the amounts with descriptions containing "Endicia".
I tried =VLOOKUP(SEARCH("endicia",D9,0)="true",D2:F12,3) but that didn't work.
I tried using SumIf instead, with similar lack of success.
Any advice would be much appreciated
IF helpful, the description is in column D and the amount is in column E.
If you can add an additional column, you can add one in that only counts the number if the keyword ("ENDICIA") is found in the cell (otherwise return 0).
=IFERROR(IF(FIND("ENDICIA",D1),E1,0),0)
From there you just need to sum the column where you put this formula.
Please try:
=SUMIF(D:D,"*ENDICIA*",E:E)

Excel INDEX/MATCH formula

I need to download warehouse inventory levels in a CSV, every morning, and update my website inventory CSV based on those numbers.
I've combined them into one worksheet.
Image: http://i62.tinypic.com/1zqxd7n.png
Column K contains the SKUs of all the items in my online store.
In column A is the list of the warehouse's SKUs, sorted to only display out-of-stock items.
I need to go down column A and see if that SKU exists in my store by looking in column K. If it's not in column K, ignore. "999999999" just means "in-stock." If it is in column K, write "0" in the cell one right of it, for "out-of-stock."
I'm looking for the formula for column L. So far I've tried something like =0*(INDEX(K:K,MATCH(A3,K:K,0))), but I think I've got it all wrong.
This problem is similar to the one here, but slightly different.
I would greatly appreciate your help, it would save me a LOT of time. Thanks in advance!
Eric, . The following formula should give you what you are after. I have replaced '999999' and '0' with a narrative return, as the logic (in the question) for whether or not an item is in stock appears to be the wrong way around.
Since an error would ordinarily be returned by a straight Index/Match formula, when a value cannot be found, you can build that into the formula.
=IF(ISERROR(INDEX(K:K,MATCH(A3,K:K,0))),"Cannot Find in Col K","Can Find in Col K")
You don't really need INDEX function if you aren't retrieving any values, perhaps try this formula:
=IF(COUNTIF(K:K,A3),999,0)
That will return 999 if A3 exists in column K, otherwise 0

Resources