Count based on Week and Year for cells having Hyphens "-" - excel-formula

I have a tasks tracking sheet and want to count number of tasks received based on week number for a particular year. Thanks for the post COUNTIF date occurs in same week number and year
But still i have problem that i have dates in a column where many of the cells are non-empty and filled with Hyphens "-". If i delete Hyphens, formula working fine. But i need to keep "-" in cells where date not entered.
Initially i tried 'Sumproduct' funtion, it shows #Value error because of Hyphen in cells. And i added the code --(Task_Status!$X$7:$X$250<>"-"). But still it showing same error. In my formula, where Q2 is weeknumber 1 to 58 in a rage of cells Q2 to BQ2, that i have to copy(drag) the formula from Q3 to BQ3. And $C$3 is cell having 4 digit Year (E.g. 2019). Please help...
A image here-->Received&Completed_CW
=SUMPRODUCT(--(ISOWEEKNUM(Task_Status!$X$7:$X$250)=Q2),--(YEAR(Task_Status!$X$7:$X$250)=$C$3),--(Task_Status!$X$7:$X$250<>"-"))

Perfect i found a temporary formula... Its working fine if non-hyphen "-" exist until end of cell range specified by INDIRECT function...
=SUMPRODUCT(--(ISOWEEKNUM(INDIRECT("Task_Status!$X$7:$X"&COUNTIFS(Task_Status!$X$7:$X$250,"<>-")+6,TRUE))=Q2),--(YEAR(INDIRECT("Task_Status!$X$7:$X"&COUNTIFS(Task_Status!$X$7:$X$250,"<>-")+6,TRUE))=$C$3))
Please give a better solution than this if anyone found... Because still Hyphen present between start cell X7 and end of cell range specified by INDIRECT function give no result... still need help...
Thank you for all who tried for a solution... and thanks to post Excel Define a range based on a cell value and Using the value in a cell as a cell reference in a formula?

Related

IFERROR VLOOKUP Sheets

Frustration finally boiled over and had to post here.
I have a Google Sheet where I want a sheet (LOG) to have a formula that will search for a name on a different sheet (DAY 1), and if the name has a value in the cell adjacent to it, that the formula on DAILY return that adjacent cell value.
Right now, I am using an IFERROR to lead the equation. This will return a value of "0" for when a name does not occur (since different names will occur on different days).
Then I attempt a VLOOKUP, and I think I'm putting the criteria in correctly, but it doesn't give me the answer I want. That is in the document, I want cell B4 on page LOG to reflect that the name Smith, John is found on the page DAY 1, and that there is a value on cell C4.
Can anyone assist with this?
https://docs.google.com/spreadsheets/d/10tS6gqtEpp55OJpYa1jSMKmbm8qU5ZzRu0rqFWHegi0/edit?usp=sharing
You have errors in formula
=IFERROR(VLOOKUP(A4,'Day 1'!A4:A13, 3,FALSE, 0))
You specify parameter 3 - colindex=3 while parameter 2 - range consists of one column
Incorrect placement of brackets
Correct formula:
=IFERROR(VLOOKUP(A4,'Day 1'!A4:C13, 3,FALSE), 0)
In this case VLOOKUP isn't your best option, try using SUMIFS instead:
=SUMIFS('Day 1'!$C$4:$C$13,'Day 1'!$A$4:$A$13,A4)
This function fills your need.
I would also recommend having one tab for all your "raw" data for each day like this:
And using this formula instead, you can drag right and down now:
=SUMIFS('Day 1'!$D$4:$D,'Day 1'!$A$4:$A,B$2,'Day 1'!$B$4:$B,$A4)
Hope you find this more useful :)
-this is my first post
https://docs.google.com/spreadsheets/d/1LXgZfKvUt7lrp4E8tAqaYEmSmZwjEbDYcQD8j1jHReY/edit?usp=sharing

Pass a changable named range as formula argument

I have a formula that checks data on another sheet that is part of a set of sheets that are calendars for given years (2019, 2020,...).
In this formula I check the number of workingdays like this:
=NETWORKDAYS(A28;EOMONTH(A28;0);INDIRECT(B28& "!B58:D73"))
where B28 is the year I want to check.
No I need a small change as I have a named range Holidays_Vacations_yyyy where yyyy is the year. This way the formula should be something like
=NETWORKDAYS(A28;EOMONTH(A28;0);INDIRECT("Holidays_Vacations_" & B28))
This way, when B28 is 2019, the formula should check named range Holidays_Vacations_2019.
But it just gives a #VALUE! error. I must be tired because I cannot find a solution. Any ideas?
Thanks in advance.
PS: In Portugal, Excel uses semicolon instead of comas as field separator.

How to check if a cell is the 17th of any month

I have a column of dates (daily) and I want an IF statement that will check if the corresponding cell is the 17th of any month.
I'm happy with the syntax of if statements but am unsure how I should be using wildcards here. 'x'below can be any numerical value.
The cell in question looks like - 17/07/2019.
= IF( cell = 17/**/****,x,0)
Excel gets confused and tries to show me how to do maths without a formula.
If you already know that the date is not a text value you can use a simple formula like:
=IF(DAY(A1)=17,”x”,0)
The only issue is that your dates may be genuine Excel dates or text values. With data in A1, in another cell enter:
=IF(ISNUMBER(A1),IF(DAY(A1)=17,"X",0),IF(LEFT(A1,2)="17","X",0))

SUMIF formula does not work if the criteria range cells contain formulas instead of just values

I have a time tracker and trying to count time spent in a given week using SUMIFS.
The week column is a formula that gets the week number from the date, and not a value by itself, and that seems to be tripping up the SUMIFS calculation, and it just returns SUM of zero. If I replace the formula with a written week number, it works.
Is there a way to force SUMIFS to work with the formula, or make it see the value of the cell instead of the formula?
A B C D
wk48 johnny 29-11-18 misc 10
wk48 johnny 29-11-18 inbound 130
wk48 johnny 29-11-18 meeting 30
Column A is =WEEKNUM(C,2).
My SUMIFS formula is =SUMIFS(D:D,A:A,"wk48"), but like I said, it only returns zero. If I change the data in column A to be just text instead of getting the week number by formula, it works just fine.
(I'm using SUMIFS instead of just SUMIF because I want to add other criteria as well, but for now I'm trying to get the individual criteria working before combining them together, and I'm stuck on this one.)
Any ideas? Thanks.
the WEEKNUM formula returns numbers, 48 in your case, and not the string "wk48". I suspect this is how the cell is formatted (the same way you can have a dollar sign in front of a number). Try =SUMIFS(D:D,A:A,48).

SUMPRODUCT and WEEKDAY ignore #VALUE error but keep values

I really appreciate your help on this one.
I have a spreadsheet that we switch out every week with a new one. But it keeps track of our numbers Monday through Friday. The problem arises with a date column (column D), a invoice hours column (column N), and a cell that keeps track of hour totals by WEEKDAY.
The cell that keeps track of totals is where the #VALUE error arises (and I know why but I'll get to that). The formula is such:
=SUMPRODUCT((WEEKDAY(D902:D978)=2)*N902:N978)
In this instance, it would be keeping track of the number for Monday. It actually works fine, except I had an idea to automate the date in column D:
=IF(AND(B904<>"", D903=TODAY()-1), D903+1, IF(AND(B904<>"",D903<>TODAY()-1),D903,IF(B904="","","")))
(Column B is the name of the company for whom the numbers and hours are attributed).
As you may've guessed, it results in a #VALUE error because of the above formula in the blank cells in column D. If I were to use SUMIFS it ignores the error, but I cannot get it to accommodate the WEEKDAY function. SUMPRODUCT accomodates the WEEKDAY function, but I can't get it to keep the values but ignore the empty cells containing the formula.
Please let me know if I need to clarify in any way.
It's a little hard to follow, but try this:
=SUMPRODUCT((ISERR(D902:D978)=FALSE)*(WEEKDAY(D902:D978)=2)*N902:N978)
Or this...
=SUMPRODUCT((ISBLANK(D902:D978)=FALSE)*(WEEKDAY(D902:D978)=2)*N902:N978)
An array formula will do what you are looking for.
your current formula would transform from a SUMPRODUCT to a SUM with an IFERROR formula
=SUM(IFERROR((WEEKDAY(D902:D978)=2)*N902:N978,0))
you will then need to enter it using Ctrl+Shift+Enter
you will see {} appear around the formula when entered correctly.

Resources