I would like to identify which rows don't have consecutive data. For this, I'd like to be able to count the cells across rows until and empty cell is encountered.
Please look at the the screenshot of an example and desired output.
I have tried to play around with the MATCH function, but no look yet. I've tried the following but it's not returning what I would've expect.
{=MATCH(FALSE,ISBLANK(C2:F2),0)}
You may try in this way however there might be a more eloquent way to solve this,
So the formula used in cell G2
=IF(MAX(FREQUENCY(IF(C2:F2,COLUMN(C2:F2)),
IF(C2:F2=FALSE,COLUMN(C2:F2))))<3,"Jumps A Year",
MAX(FREQUENCY(IF(C2:F2,COLUMN(C2:F2)),
IF(C2:F2=FALSE,COLUMN(C2:F2)))))
And Fill Down!
Also note, depending on your excel version you may or may need to press CTRL+SHIFT+ENTER, not just ENTER after entering the formula. You will know the array is active when you see curly braces { } appear around your formula.
Related
Is there anyway to use AVERAGEIF or a similar function that treats text value as 0 and not just ignore them. Something similar to AVERAGEA function, but with multiple criteria?
I saw a similar question here which wanted to treat blanks or empty cells as 0. The answer suggested to use array formulas to add 0 to it. Not sure if it holds for other texts as well.
If you do NOT want to count blanks, you can use:
=SUM(A1:A10)/COUNTA(A1:A10)
(If you wanted to count blanks, something like sum(rng)/rows(rng) would do it)
You can use a similar technique to include criteria for AVERAGEIF
For example, given:
If you want to average all the values in Column A where a is in Column B:
=SUMIF(B1:B10,"a",A1:A10)/COUNTIF(B1:B10,"a")
It would be similar to the other link:
=AVERAGE(IFERROR(--A1:A10,0))
It is an array formula and with Excel to confirm an array formula one must use Ctrl-Shift-Enter instead of Enter when exiting edit mode.
One Note: This will treat blanks as 0 also, so make sure it only refers to the data set desired.
Similar to Rohan's post, I personally would break it down to see how many strings are pushing down your average. But if you want it all in one cell:
That is an asterisk inside the double quotes
one cell: =SUM(E1:E10)/(COUNTIF(E1:E10,"")+COUNTIF(E1:E10,"<>*"))
break down:
Non-Numeric: COUNTIF(E1:E10,"*****")
Numeric: COUNTIF(E1:E10,"<>*")
spreadsheet link
1
Is the first time writing a command in excel so I have no particular idea what I'm doing.
As you can see from the image I'm trying to get in the "All Stores" column all the Stores that have the "X" in them.
At the moment the command that I'm using is displaying the output of the first cell where it finds an "X".
I have looked at some examples that I found on this topic, but I didn't find something concrete. I've tried to do it with "SUMIF" and also I've tried to use "&" in from and after "B2", "C2", "D2", but all I got was an error.
Everything that I found on this topic was how to combine numbers.
In this particular example the expected result would be "Store1, Store3".
Thank you for your support!
Yyou could use the following:
=TEXTJOIN(", ",TRUE,IF(B2="x",B$1,""),IF(C2="x",C$1,""),IF(D2="x",D$1,""))
And populate down for other products
Though it could get unwieldy if you have a lot of stores. I'm pretty sure someone else will come up with a more clever answer, but I can't think of anything else at the moment.
In E2 enter the array formula:
=CHOOSE(COUNTA(B2:D2)+1,"",INDEX(B$1:D$1,MATCH("x",B2:D2,0)),TEXTJOIN(", ",TRUE,IF(B2:D2="x",B$1:D$1,"")),"All stores")
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
The logic is:
First of all, I image you have over several columns that you want to consider. SO you can get this date in a new worksheet by replacing "x" or a mark of choice using below formula:
=IF(A2<>"", A$1, "") just autofill to get all the values in the new worksheet.
Now focussing on the new worksheet. e.g.
Apply below formula to get the required result
=IF(COUNTA(H2:J2)-COUNTBLANK(H2:J2)=COLUMNS(H2:J2),"All Stories",TEXTJOIN(",",TRUE,H2:J2))
You can try this array formula:
=IFERROR(TEXTJOIN(",",TRUE,INDEX($A$1:$F$1,1,AGGREGATE(15,6,1/(B2:F2="X")*COLUMN(B2:F2),N(IF(1,ROW(INDIRECT("1:"&COUNTA(B2:F2)))))))),"")
To enter/confirm an array formula, hold down ctrl + shift while hitting enter. If you do this correctly, Excel will place braces {...} around the formula seen in the formula bar.
I have a question regarding COUNTIFS. The simple boiled down version of what I am trying to do is this:
I am trying to use COUNTIFS to count the number of entries that the cell in a column is either blank or in the future (greater than today) and that is marked with an “X” in another column.
There are several other renditions in the formula but if I can get this, I can get the rest. So far, I have this:
=SUM(COUNTIFS($C$2:$C$50,{"";">"&TODAY()},$E$2:$E$50,"X"))
Excel won’t let me return out of the formula and highlights the quotation mark following the greater than symbol.
=SUM(COUNTIFS($C$2:$C$50,{"";">100"},$E$2:$E$50,"X")) works fine when I play around and test things but when I try to add in &TODAY() or reference a cell, things go sideways.
Any suggestions as to what I am doing wrong? The actual formula is quite long and there are several comparisons that are made between columns. I've seen some references to using SUMPRODUCT but haven't been able to figure it out that way either.
You can use a formula to generate the criteria array, i.e.
=SUMPRODUCT(COUNTIFS($C$2:$C$50,IF({1;0},"",">"&TODAY()),$E$2:$E$50,"X"))
I used SUMPRODUCT in this version because with SUM you'd need CTRL+SHIFT+ENTER
The IF function generates an array that resolves to something like this:
{"";">43060"}
I'm trying to use formula to copy data from one worksheet to another where a column matches a certain value.
To be more specific, I want Working!A2:E100 to contain Data!A2:E100 but only for those rows where Data!C2:100 contains the value "Fixed".
Doing this with leaving blank rows is simple, I just create the formula:
=IF(Data!$C2="Fixed", Data!A2, "")
And copy that formula across all the cells.
But then I thought I'd get clever and have it not copy across blank lines, and entered a maze of unclear excel tutorials and vague error messages.
I've created this formula:
=INDEX(Data!A2:Data!A200, MATCH("Fixed", Data!$C$1:Data!$C$200, 0))
And entered it as an array formula using ctrl shift enter.
However all I get is the contents of Data!A2 repeated over and over in every cell of my spreadsheet.
Does anyone need to know what I need to do to make this work?
This is my attempt at a local prototype following the example in BruceWayne's answer, the results are visible:
As you can see "Row 2" just appears repeatedly in the result column. Excel doesn't seem to have an easy way to see what version it is any more but this seems to be a pretty recent one, it's got the ribbon with the file menu and all menu headings are capitalized.
Here's a formula you can use (note: enter this as an array):
=IFERROR(INDEX(A$1:A$200,SMALL(IF(C$1:C$200="Fixed",ROW(A$1:A$200)-ROW(A$1)+1),ROWS(A$1:A1))),"")
You may need to tweak the ranges, I think I got them to match yours, but again, probably need to tweak. You can then drag this down, and it'll fill in with the values from column A, skipping any blanks.
Edit: Here's a screenshot to (hopefully) help show what I did:
You can edit the ranges, naturally, to be over two sheets.
To clarify, A$1:A$200 is the range of what you want to return (the index). C$1:C$200 is the range that holds "Fixed".
I am using excel 2010 and looking to use IF statements to add multiple columns that have both letters and numbers. I have come as far as to get all the coding in so that when one of each condition is presented they total correctly.
The problem I am having is if there is more than one of the same condition.
For example the IF statement I am using is: =IF(ISNA(MATCH("1P",C7:CO7,0)),0,1)+IF(ISNA(MATCH("2P",C7:CO7,0)),0,2) and so on.
Obviously between cells C7 and CO7 there are many cells and if more than one cell has 1P or 2P in it the additional cells are not being added and only one. How can I get my formula to recognize the condition in more than one cell?
Thanks
=COUNTIF(C7:CO7,"1P")+2*COUNTIF(C7:CO7,"2P") should get you the answer you need
Edit: Fixed formula - thanks #Andy
If you are interested in a flexible approach that allows for an arbitrary number of match values and multipliers, you could try this.
Make a little table somewhere of Match Values and corresponding Multipliers and use this array formula:
=SUM(IF($C$7:$CO$7=$A$2:$A$5,$B$2:$B$5,0))
Commit the array formula by pressing Ctrl+Shift+Enter.
Note my screen shot truncates the data range. 14 is the correct answer for the data I entered.