please fix this excel formula - excel-formula

I have the following formula that uses Named Ranges:
=SUM(COUNTIFS(BuildingNameLeases,A22,
Lease_Move_In_Date,"<"&$T$1,
vacated_date,{""","<"&$T$1-2"}))
It is not working and I don't know how to fix it.
It should be finding count of all building names [BuildingNameLeases] that match A22 where the move in date is before the date in T1 and the vacated date [vacated_date] is blank or 2 days before T1

Your last parameter is the problem. Arrays must be either ranges such as A1:B7 or absolutes such as {4,"hello",7,"world"}. They cannot contain cell references such as {T1,L7}.
To apply the logic you stated, you could do:
=SUM( (BuildingNameLeases=A22) * (Lease_Move_In_Date < $T$1) * (ISBLANK(vacated_date) + vacated_date < $T$1-2) )

Related

How to sum the value of 2 rows with vlookup by only using 1 formula?

Here is what I did
=VLOOKUP(M3,P2:Q23,2,FALSE)+VLOOKUP(N3,P2:Q23,2,FALSE)
I want to sum the values with just one formula and not repeat it
Im using Excel Online
I tried =XLOOKUP(M2:N2,P3:P23,Q3:Q23) but I get a value error,does anyone know how to do this ?
Perhaps you can try in Excel Online:
• Formula used in cell C3
=SUM(SCAN(0,M3:N3,LAMBDA(x,y,VLOOKUP(y,P3:Q12,2,0))))
Works for me in Google Sheet as well
• Formula used in cell C3
=SUM(SCAN(0,M3:N3,LAMBDA(x,y,VLOOKUP(y,P3:Q12,2,0))))
This works if, and only if, you are certain the M2 and N2 will not be the same value:
=SUMPRODUCT( ( (P2:P23=M2) + (P2:P23=N2) ) * Q2:Q23 )
If you want N2 = M2 to be valid and result in the number added twice, then:
=SUMPRODUCT( (P2:P23=M2) * Q2:Q23 ) + SUMPRODUCT( (P2:P23=N2) * Q2:Q23 )
But then you are back to repeating the formula.
I used M2 and N2 for the lookup values; your post uses row references 2 and 3 sometimes interchangeably.

MS-Excel Array Formula Problem : How do you get all the value in an array except the last one?

Now that I have found the way to make an array of dates from a date range (Ex. 12-08-19 to 17-08-19) using the following formula:
cell c2 : 01-10-18
cell d2 : 03-10-18
cell e2 : {=ROW(INDIRECT(C2&":"&D2))}
Result : {43374;43375;43376}
However, I need to get all the date from this array except the last one - then make it split out those day and put them under the column or row and later count for how many ; let say ; 01-10-18 in case that I have lots of date ranges containing 01-10-18.
In addition - each date range comes with created date - and I also want to assign the create date to those value as well so later I can accuulate numbers of Ex. 01-10-18 and compare between 2 created date for how many 01-10-18 has increased between a certain created date range.
Thank you in advance for your help :)

Alternate to STDEVPIFS

I am trying to do STDEVP on a range of cells matching date range. I did not find STDEVPIFS. I would like to know how I can accomplish this?
We have excel rows like this. I need a formula for Column E which is standard deviation for 3 months multiplied by num days A. Num days cannot be 90 (3 months) as we need to include only working days and not saturday / sunday or holiday.
FORMULA1 = STDEVP(ColumnB[between[C1 & D1]])* SQRT(NUM A ROWS BETWEEN C1 & D1)
FORMULA2 = STDEVP(ColumnB[between[C2 & D2]])* SQRT(NUM A ROWS BETWEEN C2 & D2)
ROW A B C D E
1 03-01-2007 1-1-2007 31-3-2007 FORMULA1
2 04-01-2007 0.000495 1-4-2007 30-6-2007 FORMULA2
3 05-01-2007 -0.00662 1-7-2007 30-9-2007
4 08-01-2007 0.002055 1-10-2007 31-12-2007
5 09-01-2007 -0.00055 1-1-2008 31-3-2008
6 10-01-2007 0.002059 1-4-2008 30-6-2008
..
..
60 30-03-2007 0.004350
01-04-2007
If there is not a FUNCTIONIF or FUNCTIONIFS then using {=FUNCTION(IF(...))} instead can be the alternate. This is an array formula which uses the array returned by IF as a function parameter for the surrounding FUNCTION.
Such array formulas can be entered in Excel by typing in the formula without the curly brackets. Then press Ctrl+Shift+Enter. Then the curly brackets are added automatically.
In your example, if column A contains only the working days, then the {=STDEVP(IF...))} would be:
{=STDEVP(IF(($A$1:$A$1000>=$C1)*($A$1:$A$1000<=$D1),$B$1:$B$1000))}
In array formulas one should not using whole column references since those contain more than one million cells in modern Excel versions.This would lead to performance issues. That's why do using $A$1:$A$1000 instead of $A:$A and $B$1:$B$1000 instead of $B:$B.
The counting the number of days would be:
=COUNTIFS($A$1:$A$1000,">="&$C1,$A$1:$A$1000,"<="&$D1)
I am not clear about the sense of your complete formula. That's why please put it together your own.

Set Equals * in one criterion in Excel AVERAGEIFS

Here is a generic version of the formula we are working with:
=AVERAGEIFS ( [Average Range] , Active_User, = TRUE, START_YEAR, [Cell A1] )
In Cell A1, we want to allow the user to select a specific year (2016,15,14) as well as select ANY Year (*).
Is there a string can we put into Cell A1 that will function as a wildcard?
We've tried * ; "" ; "20*" - also tried changing the fixed reference to something like "="&[A1] or ">="&[A1]. All return Div#0
Realize that this can be done by dropping the START_YEAR criterion from the formula, but we would like to avoid using VBA to modify the formulas. This is in a table with multiple similar AVERAGEIFS so there would be many items to modify.
Have you tried something like ">1900"? This would look for any date after 1900, which should cover all eventualities... assuming you're not analyzing 19th century events.

Excel formula that multiplies the value of a cell times 2 only if it is under $.99

Hello and thank you for your help! I am writing a formula to help me calculate coupon deals for my shopping trip.
My store doubles coupons $.99 or under, so I need a formula that does the following:
If the value in cell D2 is less than $1.00, multiply the value by 2 and spit it out in D3.
I tried writing my own formula but it is not working, obviously :( =PRODUCT(IF(D2<"$1.00")D2 * 2)
Any ideas?
Somethign like this should do the trick, giving you the double amount if < $1, otherwise giving you the non-doubled amount.
=IF(D2<1, D2*2, D2)
("," might have to be ";" depending on Excel's whims and localisation settings :) )
Providing you have the value of the cells formatted with $ a the start, the following should work when entered into cell D3:
=IF((D2<"$1.00"),D2 * 2,D2)
If the cells are formatted as numbers to 2 d.p use the following:
=IF((D2<1.00),D2 * 2,D2)
Thanks

Resources