INDIRECT FORMULA - excel

I am having trouble working out an error I am having with the formula below, I am a bit of a novice and its been more trial and error than anything so far but, I was hoping someone with a far greater knowledge could point out where I am going wrong.
The formula works fine without the indirect element I.e.
=SUMPRODUCT((PARROT!$o$12:$o$250<>"COMPLETE")*(PARROT!$n$12:$n$250<TODAY()))
but I want to replace the sheet name with an INDIRECT address as the name of the sheet could change
so the formula I came up with is but, it has an error:
=SUMPRODUCT(INDIRECT("'"&$A3&"'!$o$12:$o$250"),"<>"&"Complete")*(INDIRECT("'"&$A3&"'!$N$12:$N$250")<TODAY())
Help would be very much appreciated.

From your formula it seems you are just counting rows where O12:O250 is not equal Complete and N12:N250 is earlier than today. So, you can use COUNTIFS() formula with INDIRECT() easily. Try below.
=COUNTIFS(INDIRECT($A$3&"!$O$12:$O$250"),"<>Complete",INDIRECT($A$3&"!$N$12:$N$250"),"<"&TODAY())
If you need to sum values from a column then SUMIFS() will be your friend.

Related

N/A error while using the correct VLookup formula to get value from other sheet

In excel, I was trying to get fund value of a particular mutual fund by using VLookup to search another sheet. In the process, I am getting N/A error even if the VLookup formula seems correct.
The below screenshot is of the sheet with the VLookup excel formula:
Is there any issues with the vlookup formula that I am using here.
=VLOOKUP(D4,Sheet1!$A$5072:$E$5075,5,FALSE)
I have tried many version of the vlookup but to no avail. Could anyone please help? Thanks!
Cleaning the data is the best option, so that both values are either all text, or all numbers.
But a quick and dirty work aroubd would be to use to convert the text to numbers
=INDEX($E$5072:$E$5075,MATCH(D4,VALUE($A$5072:$A$5075),0))
or
=XLOOKUP(D4,VALUE($A$5072:$A$5075),$E$5072:$E$5075,,0,1)
Agree with Chris Neilsen that this is most likely a case of different formatting between the lookup item vs lookup array. The left alignment implies that both are formatted as text. Given this, just double check that both indeed are formatted as text vs. someone left-aligning a column of numbers.
Let us know if that doesn't solve the problem and we can walk you through replacing this formula with an Index+Match formula.

Excel Formula Help INDEX MATCH Dates

I have been working on this formula for the last 40 minutes and I can't really figure out where I'm doing wrong. I would really appreciate the community's help.
I have provided a screen shot below.
For some reason the formula is only taking the first instance of the currency provided in "column O:O" and it is not adding up the multiple instances of the matching months and year. I tried putting SUM in the formula but I got an error.
INDEX/MATCH And VLOOKUP will only return the first instance.
You will need to use SUMPRODUCT() to return what you want:
=SUMPRODUCT((MONTH(D17)=MONTH($M$2:$M$6))*(YEAR(D17)=YEAR($M$2:$M$6)),$O$2:$O$6)
Note: SUMPRODUCT is an Array Type formula an thus the cell references should include only those that have data and avoid full column data.

Excel Indirect inside a sumproduct

I'm pretty new with excel, but I have created a formula to calculate something from data I get from a sensor.
=100*((SUMPRODUCT(C16:C98,A16:A98)-SUMPRODUCT(C16:C98,A15:A97)+SUMPRODUCT(C15:C97,A16:A98)-SUMPRODUCT(C15:C97,A15:A97))/53.2)/((SUM(A16:A98)-SUM(A15:A97)))
as you can see it's quite long, and the values differ from time to time (sometimes it starts on c16 sometimes on c35,...)
I've tried adding an indirect link in the formula as the following:
original: SUMPRODUCT(C16:C98,A16:A98)
added indirect link: (SUMPRODUCT(INDIRECT(M25&":"&M26&","&M27&":"&M28)))
but this gives me a #REF! error.
Does anyone have an idea? Cheers.
B.
Edit: the M25 - M28 are the cells where I'll be putting my starting and ending cell number in. so in this case it would be "C16" in M25, "C98" in M26, "A16" in M27, "A98" in M28
You need to use INDIRECT for each array, try this:
=SUMPRODUCT(INDIRECT(M25&":"&M26),INDIRECT(M27&":"&M28))

Excel Nesting IF in SumIfs

Ok. So i'm looking to nest IF in my SUMIFS formulas. The only problem i'm having is when one of my referenced cells show FALSE, the formula no longer works. How do i get the formula to completely remove that Criteria from the SUMIFS formula and still work?
Codes i've used.
=SUMIFS(R:R,IF(BE4=TRUE,I:I),IF(BE4=TRUE,BD4),J:J,BD5)
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4),0)+IF(BE5=TRUE,SUMIFS(R:R,J:J,BD5),0)
I've even tried breaking the SUMIFS formula into multiple cells, and using IF and INDIRECT to create a working code. Just keeps popping up with #REF error.
Here's that code
=INDIRECT(CONCATENATE(BK1,IF(BE2=TRUE,BK2,""),IF(BE3=TRUE,BK3,""),IF(BE4=TRUE,BK4,""),IF(BE5=TRUE,BK5,""),BK6))
Here's the code that didn't work before the IF.
=INDIRECT(CONCATENATE(BK1,BK2,BK3,BK4,BK5,BK6))
Any help would be greatly appreciated.
Thank you
Mock Sheet
https://www.dropbox.com/s/tl64vbsalcqxqdm/CriteriaIFS.xlsx?dl=0
Try this formula:
=SUMIFS(BK1:BK6,BK1:BK6,">=0")
Please try this formula,
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4,J:J,BD5),SUMIFS(R:R,J:J,BD5))
Your formula
=SUMIFS(R:R,IF(BE4=TRUE,I:I),IF(BE4=TRUE,BD4),J:J,BD5)
You are saying:
Sum from column R everything if match in J with BD5 and IF BE4 is TRUE THEN in I IF match with BD5. Well, the error is because, if BE4 is true is returning a string not a range. Instead you could use this:
=SUMIFS(R:R,INDIRECT(IF(BE4=TRUE,I:I)),INDIRECT(IF(BE4=TRUE,BD4)),J:J,BD5)
And it will be ok, until BE4 is FALSE. because the INDIRECT function return an #REF!... and will be a mess.
I'm not sure if I get the whole idea, but please tell me if you need an emprovement.
Edit #1
Reading your comments I think this could help:
=IF(BE4=TRUE,SUMIFS(R:R,I:I,BD4),0)+IF(BE4=TRUE,SUMIFS(R:R,J:J,BD5))
Try to post some dummie database (using text table format) to give you a better help... and remember to read this: How to ask because your question is to vague, and it was necesary to many comments and answers to "guess" what you really want.
Try this array formula:
=SUMIFS(N:N,IF($A$2,E:E,T:T),IF($A$2,$C$2,""),IF($A$3,F:F,T:T),IF($A$3,$C$3,""),IF($A$4,H:H,T:T),IF($A$4,$C$4,""),IF($A$5,I:I,T:T),IF($A$5,$C$5,""))
It is an array formula and must be confirmed with Ctrl-Shift-Enter.
This is based on your data sheet provided. You will need to change the references to your sheet. The column T reference should be a column that is empty.
I needed to do the same thing. The formula needed to look at a different column as Criteria_Range2 depending on product. I put an IF statement for both the Criteria_Range2, and for the Criteria2 because each column had slightly different information. Basically, it tells the formula use column C (in another worksheet) as the Criteria_Range2 if the product category is anything other than Ceilings. If it is Ceilings, it uses column A as Criteria_Range2. On my worksheet, Column A is a "helper column" that groups our Ceilings sub-products into Tile and Grid.
Hopefully this isn't too confusing, but it works for me and I didn't easily find anything else out there showing how to use IF statements in the Criteria Ranges in the SUMIFS. (I suggest ignoring the very ugly xlookup defining the sum_range.)
SUMIFS(XLOOKUP($AF$20&"COGS CM MTD",Fact_Sales!$E$6:$CS$6&Fact_Sales!$E$7:$CS$7,Fact_Sales!$E$8:$CS$928),Fact_Sales!$B$8:$B$928,'Report Draft'!$AE27,IF('Report Draft'!$AD27<>"CEILINGS",Fact_Sales!$C$8:$C$928,Fact_Sales!$A$8:$A$928),IF('Report Draft'!$AD27<>"CEILINGS",'Report Draft'!$AD27,'Report Draft'!$AF27))

Excel formula returns #value when named

I am working with the following table in Excel:
The following formula in evaluates normally when entered directly into a cell:
=DATE(YEAR(DATEVALUE($A$1)),MONTH(DATEVALUE($A$1)),DAY(INDIRECT(ADDRESS(2,COLUMN()))))
However, when I try to place put this in the named function test and call =test in another cell it returns a #VALUE! error. The best answer I have come up with after researching is that named formulas and the indirect function are not always compatible.
If anyone can shed some light to help explain what I am doing wrong or why I can not put an indirect call inside of a named range I would greatly appreciate it!
Yes, I don't believe INDIRECT will work with a named range - you shouldn't really need such a convoluted formula - try just
=(C$2&$A$1)+0
format as date
Edit: as per comments below, INDIRECT is OK but I don't think COLUMN() is liked in the named range. ROW and COLUMN functions sometimes behave badly because they return "arrays" even when single values, so you need another function like MAX or SUM to convert {2} to 2, e.g.
=DATE(YEAR(DATEVALUE($A$1)),MONTH(DATEVALUE($A$1)),DAY(INDIRECT(ADDRESS(2,MAX(COLUMN())))))
although I think there are shorter methods as I indicated above....

Resources