I am trying to do a "sum if" that checks whether the month and year are the same as the criteria on the income sheet column A as well verifying the income code in column D.
I have used the option with the * as the AND function.
I am using array formulae that work independently as I have shown below, but they fail when I try to get them to work together.
I cannot figure out how to calculate the desired result.
Income summary table
Income table
Please find working formulae as follows:
Check Month and Year"
=SUM(IF((MONTH(Income!$A$3:$A$10000)=MONTH($A3))*(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000))
Check Code
=SUMIF(Income!$D$3:$D$10000,"="&$C$2,Income!$C$3:$C$10000)
Please find non-working formulae as follows:
=SUM(IF((Income!$D$3:$D$10000*(MONTH(Income!$A$3:$A$10000)=MONTH($A3))*
_(YEAR(Income!$A$3:$A$10000)=YEAR($A3),"="&$C$2)),Income!$C$3:$C$10000))
I hope that somebody can help,
Thanks
Try this:
=SUM(IF((Income!$D$3:$D$10000=$C$2)*(MONTH(Income!$A$3:$A$10000)=MONTH($A3))*(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000,0))
You can also use this SUMPRODUCT variant:
=SUMPRODUCT(--(Income!$D$3:$D$10000=$C$2),--(MONTH(Income!$A$3:$A$10000)=MONTH($A3)),--(YEAR(Income!$A$3:$A$10000)=YEAR($A3)),Income!$C$3:$C$10000)
Related
How can do I write an array formula in such a way that both following factors apply:
Results give me the names of sales that have either TRUE OR FALSE next to it in a different column/sheet.
Results are sorted chronologically based on the date that is connected to each sale. Each sale has a different date next to it. This can be found in the same sheet as where the "TRUE OR FALSE" result is displayed. Column with the dates is called "AY:AY". I use an indirect formula to target the correct sheet within the spreadsheet.
I currently only have the first criteria implemented, don't know how to do the 2nd one.
Since the raw data is not ordered I need this to happen when I use the Index Match Array formula. So far I have this formula in my Google Sheets spreadsheet.
=ArrayFormula(iferror(index(indirect("'"&$B$5&" 2023'!c:c");small(if(TRUE=indirect("'"&$B$5&" 2023'!ca:ca");row(indirect("'"&$B$5&" 2023'!ca:ca"))-row(indirect("'"&$B$5&" 2023'!$ca$1"))+1);row(1:1)));""))
I know I could use the Index Array formula below with multiple criteria, but don't know how to implement the date component.
INDEX(indirect("'"&$B$5&" 2023'!c:c");SMALL(IF(COUNTIF(_______)*COUNTIF("true"; indirect("'"&$B$5&" 2023'!CA:CA"); ROW(indirect("'"&$B$5&" 2023'!A:CA"))-MIN(ROW(indirect("'"&$B$5&" 2023'!A:CA"))+1); ROW(indirect("'"&$B$5&" 2023'!A1));COLUMN(indirect("'"&$B$5&" 2023'!A1))
Thanks in advance.
A query like this could help?
=QUERY(INDIRECT("'"&$B$5&" 2023'!C:CA"),"SELECT C,AY WHERE CA = TRUE order by AY")
I'd have another question. The situation is as follows: I have two tables (=formatted Excel tables). The situation looks as below. I am trying to filter for the $ sales amount (cell E4) of a given sales rep (cell D4). I was thinking about using =SUMPRODUCT(IF((Table2[Store ID]=INDEX(Table1[Store ID],MATCH("Marc",Table1[Sales Rep],0),)),1,0)) (as I would have other conditions such as month which are no displayed in my example below), however, that's not giving me the correct value. The index-formula gives me just the first result once it finds "Marc".
The "correct" result in the example shown would be $121 as Marc accounts for these sales in the store with ID 1.
How can I overcome this problem? Any help would be much appreciated.
Add an additional column [shop ok] with a formula =IF(F7=$D$4,[#[store ID]],0) into Table1, to indicate that this store is under Marc's control.
In E4 insert a formula
=SUMPRODUCT(Table2[Sales]* COUNTIF(Table1[shop ok],Table2[Store ID]))
It's an array formula, so add it using Ctrl+Shift+Enter
didn't manage to avoid adding additional columns, got some errors, so ended up with this solution for now.
In E4, enter formula :
=SUMPRODUCT(SUMIFS(I7:I9,H7:H9,D7:D9)*(F7:F9=D4))
I am looking for some help regarding an IF function on an Excel document.
Basically if the Date Listed cell is dated over 1 month ago (eg: Date Listed 6-Aug but today is 6-Sep) and the Date Sold cell is blank, then I would like the Mark Down cell to say 'MARK DOWN', which at the moment it does but it is only 10-Aug today.
If the Date Listed cell and the Date Sold cell both contain dates I would like the Mark Down cell to say 'OK'.
So far I have this written:
=IF(AND(DATE(YEAR(G2),MONTH(G2),DAY(G2)), ISBLANK(H2)),"MARK DOWN","OK")
I know I'm not far off but I need help sorting out the last parts..
Bonus if you can help me add a highlighted cell formatting to it :)!
[EXAMPLE IMAGE]
I think this should work
IF(AND((TODAY()-g2)>31,ISBLANK(H2)),"Mark Down","OK")
Apply conditional formatting on all the cells in MARK DOWN column which are equal to OK.
After that write this simple formula to check the condition.
=IF(AND(ISNUMBER(G2),ISNUMBER(H2)),"OK","MARK DOWN")
Update: if you use EDATE function everything gets simplified as this function takes care of exact day differences
so the whole solution is :
=IF(AND(EDATE((G2),1)=EDATE(NOW(),0),ISBLANK(H2)),"MarkDown","")
Let me know if you have any question on how this formula works.
I was hoping someone can help me. I have hit a solid wall.
I have a table with product information included and I am building a calculator which should spit out a number of options based on set criteria which is in the table. I am failing at just pulling through a code. I feel rather embarassed asking about how to do a vlookup here. But basically I have a vlookup which depends on multiple criteria and for the calc to cough out the nearest match (if applicable) based on this criteria.
Criteria 1 = Product
Criteria 2 = Type
Criteria 3 = Height
Criteria 4 = Min
I have created a search key in the table to concatenate all of these columns and then done a vlookup, which is =Vlookup(Criteria1 & Criteria2 & Criteria3 & Criteria4, Table Data, Code Required) But this does not appear to be giving me results, it either coughs out an error or the incorrect product. Below is my data and my calc I am hoping to complete. Can someone please help?
Here is an example looking for a closest match on Min. It demonstrates the principle so you can extend.
The closest match formula part is:
MATCH(MIN(ABS(E2:E4-K2)),ABS(E2:E4-K2),0))
Column E for column with Min values in. And K2 for target Min. This is an array formula entered with Ctrl + Shift+Enter. You would adjust the range of E2:E4.
The multiple criteria part is using:
=MATCH(lookup_value_1&lookup_value_2&lookup_value_3, lookup_array_1&lookup_array_2&lookup_array_3, match_type)
Where you are concantenating your parameters and searching for a match of the concatenation of those parameters in the table (you could do this against the key column if the key is made up of the same parameters.)
Overall formula with some test data (using one estimate figure):
=INDEX(F:F,MATCH(K1&K5&J5&INDEX(E2:E4,MATCH(MIN(ABS(E2:E4-K2)),ABS(E2:E4-K2),0)),B:B&C:C&D:D&E:E,0))
Above entered combined formula remember is an array formula so entered with Ctrl+Shift+Enter . You can reduce the ranges from entire columns to only those rows holding data.
Data data:
I am not typing all that out from picture so here is a quick n dirty
I tried with the QHarr's solution but it didn't work with all the rows.
My solution is:
Add a column with:
=IF(E2 < $K$2, E2, 0) and copy for all rows
In L5 create the formula:
{=INDEX(F2:F19,MATCH($K$1&K5&$J$5&INDEX(E2:E19,MATCH(MAX(SI(B2:B19=$K$1,1,0)*IF(C2:C19=K5,1,0)*IF(D2:D19=$J$5,1,0)*G2:G19,0),E2:E19,0)),B2:B19&C2:C19&D2:D19&E2:E19,0))}
Copy the formula to L6 and L7
Excel exercise printscreen
Originally marked this as answered and it did work initially but as I added more products it began to fail. I did manage to (after much trial and error) find a simple solution {=INDEX(Calc!$I$2:$I$189,MATCH(Output!$H$7,IF(Calc!$B$2:$B$189=Output!A12,Calc!$H$2:$H$189),1))}
I am trying to get a count of all Unique values listed in Col A, by state and within a date range, for example all records up to the end of April 2018.
I am able to get the count of Unique values by state (result is 2) with the below formula:
{=SUMPRODUCT(1*(FREQUENCY(IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0)),ROW($A$2:$A$14)-ROW($A$2))>0))}
but I am unable to get the IF function to work with EDATE. I tried the following but I'm getting 0 as the result. The result should be 1.
{=SUMPRODUCT(1*(FREQUENCY(IF(D2:D14="<"&EDATE(G1,1),IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0))),ROW($A$2:$A$14)-ROW($A$2))>0))}
I am unable to use Pivot as I need to include date range filter. Could someone please look at my code and tell me what I'm doing wrong? I am using CSE with my formulas. Thankyou!
I managed to work it out. EDATE wasn't working so I entered the Month date in cell:G1 then referenced it in the IF formula using "<=" eg: IF(D2:D14<=G1).
Whole array formula is:
`{=SUMPRODUCT(1*(FREQUENCY(IF(D2:D14<=G1,IF($C$2:$C$14=F10,MATCH($A$2:$A$14,$A$2:$A$14,0))),ROW($A$2:$A$14)-ROW($A$2))>0))}
I now receive the correct count of 1, though I have to ensure I have entered the last day of the Month in G1. State is referenced in F10 and count of unique values is in Column A.
My full data set is sourced from multiple documents over 5000 rows each and growing daily so my workbook is quite slow to calculate over 1000 array formulas... but it works!
If anyone knows of a faster (possibly non-array) formula, I would appreciate the advice! Thanks!