Hi I am after some help with a COUNTIF formula, I want to add 1 to cell
if the 3 criteria are met (see image) =COUNTIF(K4:K20,D2 AND L4:L20,C6 AND M4:M20,B7) i can get the 2 count from =COUNTIF(K4:K20,D2) but the formula does not work with the AND L4:L20,C6 AND M4:M20,B7
Any help would be great
for first, I'd split your B column in two columns FROM and TO. This helps countifs to evaluate if time is after ( >= ) FROM and before (<) TO.
If you are asking what should you write in your C7 formula, this could be something like (according to columns in my screenshot):
=COUNTIFS(G:G,$C$5,H:H,">="&A6,H:H,"<"&B6,F:F,$B$2)
so use ">=" & cell to evaluate if time if after FROM columns; and "<" & cell to evaluate if is before TO column.
I paste this screenshot of I'd solve this problem:
screeshot
and here you have a working example
Related
I got an issue with Xlookup formula for the lookup array & return array. As the 1st one I need to manually select the range for lookup and return array, I try to use Xlookup with multiple criteria to match with the keyword instead of only matching one criteria. However, the result was appear to be different. Please help how to adjust the formula to remove the manual selecting range. Thank you.
G column is text
AE column is number
J column is text
Z column is number
W column is date
=XLOOKUP(AE3,工作表2!$Z$2:$Z$6,工作表2!$W$2:$W$6,,1)
=XLOOKUP($G3&$AE3,工作表2!$J:$J&工作表2!$Z:$Z,工作表2!$W:$W,,1)
Your sheet names showing in Chinese may be confusing some people.
I'm not aware of any syntax in Excel that allows you to concatenate columns as part of an array definition. It would be great if we could do this. The only way I know to do this is with another column and then use that for your array. You could add $J2&$Z2 to another column and then use that. If you added that to column H your xlookup() would be:
=xlookup($G3&$AE3, $H2:$H6, $W2:$W6,,1)
Here's how it looks. I showed the xlookup() functions in F9 and F10 (right aligned) and the results in G9 and G10.
I have a list of data (top to bottom with gaps) in range AM4:AM1000 which is always added to and to which i want to find and sum the last 4 results. But I only want to find those results which correspond to a separate column, range AL4:AL1000 that is equal to cell E3, and where a third column (AS4:AS1000) meets the criteria of "p".
Im using the code below which extracts the last 4 results but I can't make it meet the other two conditions. any help would be gratefully appreciated
=SUM(INDIRECT("Am" & LARGE(IF(NOT(AM4:AM1000=""),ROW(AM4:AM1000),0),1) & ":Am" & LARGE(IF(NOT(AM4:AM1000=""),ROW(AM4:AM1000),0),4)))
Iv also tried the code below but this only returns the value 0
=SUM(IFERROR(INDEX($AM$4:$AM$1000,LARGE(IF(ISNUMBER(MATCH($AL$4:$AL$1000, $E$3, 0)),IF(AS$4:AS$1000="p",MATCH(ROW(AL$4:AL$1000), ROW(AL$4:AL$1000)), "")), ROWS($I$6:$I7))),""))
Here's an array formula for you to try - make sure to enter it by using Ctrl+Shift+Enter:
=SUMPRODUCT(IF(ROW($AM$4:$AM$1000)=TRANSPOSE(LARGE(IF(--($AL$4:$AL$1000=$E$3)*(--($AS$4:$AS$1000="p")),ROW($AM$4:$AM$1000),0),ROW($A$1:$A$4))),$AM$4:$AM$1000,0))
The result of 26 matches your criteria (highlighted cells):
I have in Column C2, formula results which I need to perform LEFT on in order to trim the cell formula value
The formula result MUST have one of the following (. OR _ OR -) in answer
If one of the above exists in the cell , then LEFT(C2,FIND("the_variable_in_the_formula_answer),C2)-1)
My VBA isn't the best, but I think I could use
variable = Left(Sheet1.[C2],InStr(Sheet1.[C2],".")-1)
I don't know how to make the .(period) , _(underscore) OR -(hyphen) a variable to look for
Try this formula at row two and fill down the column:
=IFERROR(LEFT(Sheet1!C2, AGGREGATE(15,6,SEARCH({".","-","_"},Sheet1!C2),1)-1), "")
It truncates until the first found of {".","-","_"}. If you want to truncate till the last found, change 15 into 14.
For your additional requirements:
=IF(ISNA(C2), D2,
IFERROR(LEFT(Sheet1!C2,AGGREGATE(15,6,SEARCH({".","-","_"},Sheet1!C2),1)-1),C2))
I have a date dropdown on Sheet1 (=Sheet1!B5)
This helps populate Sheet1 with values from Sheet ‘Data’. I have been using Vlookup with Match formula for others. (=VLOOKUP(G20,Data!A:Z,MATCH(Sheet1!$B$5,Data!$3:$3,0),FALSE))
But Im stuck on how to use =Large formula in same way. I am trying to take top 5 values per day – using date dropdown. I can’t figure out how to dynamically change the column letter in the array =large formula to take correct values corresponding date.
So far I can directly take top 5 from column C - =LARGE(Data!C44:C65,1)
But I want this work for column D onwards..
Thanks in advance
Use this formula:
=LARGE(INDIRECT("Data!" &ADDRESS(44,MATCH(1E+99,44:44)) & ":" & ADDRESS(65,MATCH(1E+99,44:44))),1)
It will find the right most column with numbers.
Or this one uses your match from the vlookup to choose the column:
=LARGE(INDIRECT("Data!" & ADDRESS(44,MATCH(Sheet1!$B$5,Data!$3:$3,0)) & ":" & ADDRESS(65,MATCH(Sheet1!$B$5,Data!$3:$3,0))),1)
In a =COUNTIFS formula which I'm using, I am looking for data (specifically the number of granted patents) before and after a date. This date is listed in separate column and the last criteria in my COUNTIFS formula refers to this cell. However if I slide this formula downwards or sideways for my sample, the last criteria is not dynamic and keeps referring to the same cell (in the example: N2). How do I alter formula so that I can drag it downwards and sideways?
The current formula:
=COUNTIFS('1972-06-06 - 1988-01-12'!$E$2:$E$366963,'MA Acquiror Permno Cusip'!E2,'1972-06-06 - 1988-01-12'!$C$2:$C$366963,"<=N2")
I have tried a variant where the last criteria looks like:
"<=" & N2
yet this returns no hits, the previous formula does return hits but is not dynamic.
Thanks in advance for any help.
Just had this exact same problem and it took me an hour to figure out.
Apparently you need a space between the operator ("<") and the date.
"<= " & N2
^Should work. Notice the space after the equals sign.