In another forum, I found a way to make a conditional median calculation in Excel work like this:
{=MEDIAN(IF(and(BN8:BN229<44,BN8:BN229>0),BM8:BM229))}
...becomes...
{=MEDIAN(IF($BN$8:$BN$229<44,IF(BN8:BN229>0,$BM$8:$BM$229)))}
...and works (due to the nested if-statements).
However, I need to do the same with an or-clause. How, would I do this?
Already found a way:
{=MEDIAN(IF($BN$8:$BN$229<44,$BM$8:$BM$229,IF(BN8:BN229>0,$BM$8:$BM$229)))}
Related
I'm doing some online sheet/excel tutorial and encountered a problem. My hlookup is not working because the lookup value is not in the first row of the table HLOOKUP Error. So I work my way around it by adding a row at the top HLOOKUP Working but this doesnt look professional. Is there an alternative function or way to solve this without changing the table or adding row?
P.S. I know the answer can be seen directly but I'm preparing for a larger dataset.
Good Day,
try this one for the "Lowest Monthly Average":
=INDEX(B1:M1,1,MATCH(B14,B12:M12,0))
and this one for the "Highest Monthly Average":
=INDEX(B1:M1,1,MATCH(B15,B12:M12,0))
Hope it is what you are looking for.
its done like this:
=HLOOKUP(B14; {B12:12; B1:1}; 2; 0)
If you have the latest version of excel, then xlookup() will work.
Not sure that exists in googlesheets.
I'm trying to create a pricing matrix for products but using Index/Match or SumProduct formulas are proving to be a nightmare for me, I'm wondering if VBA would be easier?
Essentially if a product width or height is in between two figures, I need the price quoted to take on the next pricing bracket. (NB: Rounding up or using Ceiling functions within the formula doesn't work for me either)
Examples of the code I've tried using are:
=SUMPRODUCT(--(HeightRange=CEILING(Height,1000))*--(WidthRange=CEILING(Width,10))*PriceRange)
=INDEX(PriceRange,MATCH(MIN(ABS(HeightRange-Height)),ABS(HeightRange-Height),-1),MATCH(MIN(ABS(WidthRange-Width)),ABS(WidthRange-Width),-1))
Example Table:
Use:
=INDEX(B:J,MATCH(N3,A:A),MATCH(M3,B$3:J$3))
You could make use of =AGGREGATE() like so:
=INDEX(A:E,AGGREGATE(15,3,(($A$4:$A$11>=N3)/($A$4:$A$11>=N3))*ROW($A$4:$A$11),1),AGGREGATE(15,3,(($B$3:$J$3>=M3)/($B$3:$J$3>=M3))*COLUMN($B$3:$J$3),1))
You can use directly formulas just like both guys said above...
Mine here:
=INDEX($A:$J,MATCH($N3,$A:$A,0),MATCH($M3,B$3:J$3,0))
I was just wondering if this is the proper way to nest this many conditions. It does work, just looks like it could be written simpler.
=IF(H13>0,IF(H14>0,IF(H15>0,IF(H16>0,IF(H17>0,IF(H18>0,IF(H19>0,"Yes","No"),"No"),"No"),"No"),"No"),"No"),"No")
Above formula can be written as
=IF(COUNTIF(H13:H19,">0")=7,"Yes","No")
You can use AND
=IF(AND(H13>0,H14>0,H15>0,H16>0,H17>0,H18>0,H19>0),"Yes","No")
Also use OR
=IF(OR(H13<=0,H14<=0,H15<=0,H16<=0,H17<=0,H18<=0,H19<=0),"No","Yes")
I am trying to combine two forumlas into one.
They both work individually and I would like to make it so the condition is only met if both formulas are met. The forumlas are:
=IF(AND(Sheet2!$C$6>40,Sheet2!$C$6<=50),TRUE,FALSE)
=IF((INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3"))>=Sheet2!$B$6),TRUE,FALSE)
I have tried to use another AND clause but had no luck yet with this, would anyone be able to provide a consolidated formula for both of these?
the long way:
=IF(AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6), TRUE, FALSE)
the short way:
=AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6)
also possible:
=((Sheet2!$C$6>40)*(Sheet2!$C$6<=50)*(INDIRECT("R3C"&COLUMN(),)>=Sheet2!$B$6))=1
why the SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3")??? just ADDRESS(3,COLUMN(),4) will be the same... also why address at all? justINDIRECT("R3C"&COLUMN(),) will also work
Compiling the comments, this should be the minimal formula gathering your tests :
=AND(Sheet2!$C$6>40,Sheet2!$C$6<=50,INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","3"))>=Sheet2!$B$6)
So,
what i am trying to accomplish here is pretty straight forward, i have a column fare in my spreadsheet and i want to add anew column that would say if the fare is <10 ,10<20,20<30,30+
I came up with this solution but it seems like it is not using a shortcut condition, is there a case statement or any other method i can use to achieve what i want?
=if(J19<10,"<10",IF(AND(J19>10,J19<20),"10<20",IF(AND(J19>20,J19<30),"20<30","30+"
)))
Try something like this:
=ROUNDDOWN(A1,-1)&"<"&ROUNDUP(A1,-1)
Since the conditions in a nested set of if functions are evaluated consecutively, you do not need to repeat previous conditions using and. Also note that your original formula doesn't do the right thing at the borderlines, e.g. if J19=10.
So although Excel does not have a case function, the following is simpler and more accurate than your original:
=if(J19<10,"<10",IF(J19<20,"10<20",IF(J19<30,"20<30","30+")))