Only Calculate if fields meet criteria on on Excel Pivot Table - excel

I'm trying the calculate the days between two dates on a pivot table in Excel. I have it working correctly for the most part, yet I am having an issue with the formula trying to calculate even if one of the fields is blank. Preferably, I would want the days between to only calculate if there is a date entered in both cells, since if there is only one entered it gives me an incredibly high number.
I figured I could use something like
=IF( OR (NOT (ISBLANK('App Received Date')), NOT(ISBLANK('Quote Date'))),SUM(ABS('App Received Date'- 'Quote Date'),0)
But I cant seem to get it to work correctly. I must be missing something simple but I cant get a handle on it.
Any assistance would be greatly appreciated

Related

Using Excel Formulas to return the count of non zero in a column

I spent half the day racking my brain and playing around with the formulas i know of in the excel world but I still cannot figure out a method to do this without using VBA coding. Hopefully someone out here would be able to help provide some guidance without the use of code.
The scenario is this and refers to the screenshot above:
Objective: Determine the number of non zero values in a particular month's column for every row that has an "exceptions" label.
The month is controlled by the user input cell.
Example:
Total number of non zeros in Feb column is 6.
Actual result that I am expecting: 3 (because there are three rows with "exceptions" label and we should count the total of those rows only.)
I've tried Index/Match/Countifs/lookups but just cannot find the right combination.
Closest I came to was using the screenshot below but that only returns the total number of non zeros in that table.
Just putting the question out there for any of the excel gurus to help.
Appreciate the time and thanks in advance!
Regards,
Stan
If you do not want volatile functions like offset or indirect, you can still do it with index (your formula isn't wrong at all). Just try this:
=COUNTIFS(INDEX(F2:K7,,MATCH(G10,F1:K1,0)),">0",E2:E7,"exeptions")

Excel Sumifs Returning 0

In the attached sheet, second tab, I have a table that is formulates to present the data spent in each country per month. Upon updating it I've seen that it does not work when adding in jan 2016. I have tried different formulas, rewriting, I know the formula is correct, there just has to be something about "Jan" where it's not adding data.
Spend Matrix
Please, any help is appreciated.
I think the problem is not in the code. The problem is in the data entry.
The year shows 15 although the year is supposed to be 16 and the SUMIFS criteria is in code "16"
ADDITION CODE
=SUMIFS(DB!F:F,DB!A:A,DB!A31299,DB!D:D,"16",DB!C:C,A16,DB!E:E,"United States")
The value of the country "Jamaica" is linked back to the DB cell to get its value, this seems to get it to work.

Counting Cells in a Range that Contains Formulas, Only when a Date is Returned?

Frequent browser, first time poster. Please go easy:
I have spent the last few days searching online, and on here for a solution to a problem I have encountered for the first time. I have a report that pulls from multiple worksheets. One column is a formula that does a VLOOKUP to another sheet and pulls back a date, if it exists. I then have a cell at the top of the sheet that calculates how many dates are pulled back out of all of the rows (to calculate % complete). This is where I am having the problem. I have tried variations of COUNTIF, COUNTA, COUNTBLANK, and so on, and formulas trying to reverse calculate,
=SUM(C4)-COUNTIF(Table3[2014 Process Date],"")
At first it appeared to work, but in this example, I had 1949 rows, and dates only populated in 7 of those rows. In theory it should return 7. Instead it is returning 237. I have done multiple filters, and manually reviewed the data in the column, and only 7 dates are there. The column has the VLOOKUP in and IFERROR nest,
=IFERROR(VLOOKUP(A12,Table_TaxData.accdb3[#All],240,FALSE),"").
I am guessing I am overlooking something silly, and was hoping someone would be able to help steer me in the right direction, or let me know what I am missing. Thanks in advance for any help!
Wow, looks like I need some more coffee! Thank you, I guess I assumed that it would be much more complicated than that. I just threw in
=COUNT(Table3[2014 Process Date])
And it worked like a charm! Thanks again!
If I'm reading your formula correctly, the target cells hold either the DATE, or a blank "".
If so, you can do a COUNTIF and do this:
=COUNT(B:B)
to get # of dates.
or
=COUNTA(B:B)-COUNT(B:B)
to get # of blanks.
(I used column B, not sure where your final values are in you're looking for - adjust accordingly)

Count amount of entries within one year and other criteria

For my Pilots logbook I am trying to be able to make a easy search where you can enter certain criteria and get the amount of landings and time in flight.
For example you could enter the departing airport and it would give you the amount of takeoffs from that airport.
So far I have been able to get the results using the COUNTIFSfunction.
Trying to add a field, where you can enter a year and it would only count the occurrences in that year is giving me a hard time!
The date is in the following format: dd.mm.yyyy. The year to search for would be entered in a cell (yyyy).
Just adding it to the COUNTIFSobviously doesn't work. I know I can get the year out of the date using the YEARfunction, yet I can't figure out a way of including this into the COUNTIF.
Any Ideas?
CODE:
=COUNTIFS(Logbook!F3:F2000,IF(ISBLANK(B30),"*",B30),Logbook!C3:C2000,IF(ISBLANK(C30),"*",C30),Logbook!K3:K2000,IF(ISBLANK(D30),"*",D30),Logbook!L3:L2000,IF(ISBLANK(E30),"*",E30),Logbook!G3:G2000,IF(ISBLANK(F30),"*",F30),Logbook!B2:B2000,B30)
Where B30 is the cell with the year, and B2:B2000 being the cells with the dates.
I also tried to compare by the text (somewhat like RIGHT(Logbook!B2:B2000,4)=B30) but it doesn't do anything but returning a #VALUE error.
Seems like a really good case for PivotTables and slicers... You could even avoid the RIGHT() formula if you format the dates; then you could use the built-in group feature of PivotTables.

Excel 2003 DSUM not working

A client of mine has a major application written and running in excel 2003 ( I know, and they know, that it is a mistake, and they are waiting for it to be properly incorporated into their SAP application. They have been waiting for many years. ). Most of the time it works fine, however this week they had a problem, and the data was returning #value entries.
As I looking into this, I identified that a DSUM function was returning #value, which was then being spread across other places ( did I mention that there is no data verification in the VBA code? ) When I looked at the function, which is summing a column in a separate sheet, with a conditional, it identified a number of problems in the data, but even when I fixed them, and the Function analysis indicated no errors, it still returned #value.
I would post some of the code, but there is a 4700 row sheet involved, which is rather inpractical. Can anyone suggest what I might be able to do to progress this? Why is the DSUM returning #value problems, when there is no indication of any errors in the source sheet? I have searched through the column, and all of the values are valid numbers.
Sorry to be a little vague, but if anyone can give me suggestions as to how to progress, it would be appreciated. Excel and VBA are not my real specialities.
The only way I could get a #value was 3 fold:
If the criteria (the 3rd parameter) contained less that 2 cells.
If the data had a #VALUE in it that was propagated through.
Or if the first row of the database/table contained a value instead of text (even a number formatted as text fails in my example).
Do you still have the offending version of the spreadsheet? Might be worth ensuring the first row of data for errors particularly cells that look like text but have values in them (i.e., cell formatting can be used to display text even if there is a value in the cell, or if the first row is also calculated).
Hope this helps, and do let us know how you get on.
Dave

Resources