Using SUMIF/SUMIFS for a Column with both Numbers and Strings - google-sheets

I'm making somewhat of a bill tracker of my own in Google Sheets. This is snippet so far what I have.
Google Sheet Example Image
What I want to accomplish is on cell K2, you can see that if the cell to the right of the K column is not checked (aka it = FALSE), then it adds it to the total where I can see what the total amount I still need to keep in order to pay my bills.
Below is the formula being used for K2
=SUMIF(L5:L,FALSE,K5:K)
Now, I do have a couple of different accounts myself, so it would be useful to know which bills are taken out of what account, to get a breakdown of that too.
My problem is, I can't figure out a good way to go about this. Maybe SUMIFS is not the way to go for that. The following formula is what I tried.
=SUMIFS(K5:K, L5:L, FALSE, K5:K, "CHK 1")
Although this just returns a "$0.00" for me. I figure it's because when it checks cell K8 (as an example), it checks L8 if it is FALSE, which it is, but then it also tries to check the same K8 to see if it is equal to the string "CHK 1", but it obviously would never be correct since that is the cell with the number value I want to add.
Is there a way to make the criteria check the cell 2 spots below? I tried using...
=SUMIFS(K5:K, L5:L, FALSE, K5:K, INDIRECT(R2C0, FALSE)&"=CHK 1")
But this results in a formula parse error. I've been looking around at any other formulas that may work but I haven't found anything yet. Anyone able to help me out on this?

try like this:
=SUMIFS(K5:K100, L5:L100, FALSE, K7:K102, "CHK 1")

Related

Google sheets, two-sheet dependent conditional formatting

My problem is probably trivial ... However, I was looking for similar problems and their solutions either do not work for me or I can not apply them.
I have 2 sheets - SheetA and SheetB. They are identical. I want to select every cell in SheetA that is no longer identical to Sheet B.
I was able to use (found here on Stack Overflow) such a function in conditional formatting:
= A1 <> INDIRECT ("SheetB! A" & ROW ())
It works if the range is column A. I know that I can apply this function to each column separately, but there is certainly a way that I can apply the same formula to the whole worksheet.
Will there be anyone who can show me the correct formula?
Edit: I tried to use above formula to every column... And my file become to work very slow... So whoever wants to do the same... think again.
After some tries I decided to move everything from SheetB to SheetA. I paste it a 1000 rows under data of Sheet A. Works fine without "indirect" function. No slow downs. It is not a perfect solution but it works.
But even after my problem is solved different way, I would like to know what is the correct formula for my problem... it might be useful for the future with smaller amount of data.
Solved ;)
You should be able to use the Address function to get the address of the current cell from its row and column:
=A1<>indirect("sheetB!"&address(row(),column()))
or for case-sensitive match:
=not(exact(A1,indirect("sheetB!"&address(row(),column()))))

LOOKUP Function won't output correct value

I'm trying to create an Activity tracker for a game. However, I'm trying to use the LOOKUP function to track activity throughout 3 different sheets. However, the LOOKUP function does not seem to be outputting the correct value. LINK: https://docs.google.com/spreadsheets/d/1tdq6oeEFjgxJg6FXvSH2ZmkgRlHaFiD5aycjvezfNvc/edit?usp=sharing
If you look at Activity sheet, E2:E52, you should understand that it's outputting the wrong value(At least based on what I'm reading on the google docs).
I've tried converting this over to one sheet to see if that was the problem, however, it didn't work there either, I tried being more inclusive of the exact letter and number combination and that didn't help either.
I expect it to output the Attacks column for the username based on the Activity1 sheet.
Any help would be greatly appreciated.
PS: I tagged excel as it does the same exact thing on excel, however it gives slightly different values. I'm very confused.
use VLOOKUP instead:
=ARRAYFORMULA(IFERROR(VLOOKUP(D2:D,
{Activity1!C:D; Activity2!C:D; Activity3!C:D}, 2, 0)))

Is there a way to use ARRAYFORMULA to find the most-recent even input of a column?

SOLVED EDIT
Thank you for the help. Solution here.
ORIGINAL POST
I have made a google sheet to describe the issue I am facing linked here (https://docs.google.com/spreadsheets/d/1yK6ZAX8BFnEqiuQO9HIxuY0l62ewDDccj-8EN1r2i2w/edit?usp=sharing).
I will also describe in words, below, the problem I am facing, along with the solutions I have tried.
The data of column A are random single-digit (0-9). I would like column B to show the most recent even number from column A, but only up to a specific row. That specific row is the row corresponding to the row of the cell in column B. In other words, in cell B7, I want to find the most recently entered even number of column A, specifically only on the range A2:A7 (A1 contains a column header).
This is actually a pretty simple formula, and I can get the desired outputs by simply checking if the value in a cell in column A is even and then returning the value of that cell if it is, or the output of the cell above if it isn't. So the formula would look something like: ​=IF(ISEVEN(A7),A7,B6)​
However, my problem is that the length of the data in column A will be growing as more data are entered, and my current solution of using the fill handle to copy the formula to new cells is inelegant and time-consuming. So my desired solution is to use an array formula entered into the first cell of column B (B2), capable of returning the same value as the other formula. The formula I tried to enter to perform this was the following: ​=ARRAYFORMULA(IF(ISEVEN(A2:A),A2:A,INDIRECT(ADDRESS(ROW(A2:A)-1,2))))​
However, as some of my previous work with arrays has taught me, not all formulas iterate as expected down the array. The formula seems to be able to return the correct output on lines which are already even, but it is unable to return the expected most-recently entered even number for all the other lines. It appears that the formula is not able to appropriately interpret the ​value_if_false​ argument of the ​IF​ formula.
I'm a little new to scripting, so I'm still trying to learn, but I also tried to dabble around with custom functions to no avail. I'm still wet behind the ears when it comes to coding, which is why I've been so lenient on the built-in formulas of Google Sheets, but I fear I may have reached the limit of what Sheets formulas can do.
I am open to trying new approaches, but my only real constraint is that I would really like for this to be a one-touch (or even better no-touch) solution, hope that's not too far beyond the scope of this issue. Any assistance would be much appreciated.
EDIT
After rubber-ducking the problem here, I went back and tried to use the OFFSET formula, hoping I could get it to play nicely with the array formula. Alas, I was unable, but I thought I should at least post my progress here for reference.
Attempt with offset
Still working at it!
Doing a vlookup on the row number seems to work for me
=ArrayFormula(if(A2:A="","",vlookup(row(A2:A),{if(iseven(A2:A),row(A2:A)),A2:A},2)))
Note: if there are no even numbers in range for some rows, it will produce #N/A for those rows.

Google Sheets: CountIf and Dates

Haven't gotten any help through the Google Product Forums, so I'll try here. I've never had issues with this before so not sure what I'm missing now. I can't seem to make a rather simple formula work and I have no idea why.
For some reason, =COUNTIF(SCHEDULE!$C$9:$C29,">="&B$2) returns 0, when I'm expecting it to return 21.
In B2 is the date "6/25/2018", which is actually a reference to
SCHEDULE!C2.
Am I just not understanding the logic correctly? "If the dates in C9:C29 are after or equal to 6/25/2018, then count them."
When I try it as <= it doesn't work either.
I don't think there is an issue with the dates being formatted using TEXT(B2,"MM/DD/YYYY") because other formulas seem to be working fine.
Alternatively, I also tried using SUM(QUERY), but that also got hung up when using the dates.
=sum(query(SCHEDULE!A9:AB,"select count(F) where F='2004' and C >= date '"&TEXT(DATEVALUE(B2),"yyyy-mm-dd")&"'",0))
You can see a test version of the sheet HERE.
I am working from the REF sheet.
You can see what I've tried in Z6, Z7, Z8 and AA6.
Any suggestions would be appreciated. I feel like I'm missing something obvious. I'm not sure if it's the fact that some of the dates from the SCHEDULE page are rendered using TEXT, but I can't figure this out.
Ref!B2 is TEXT(SCHEDULE!$C$2,"MM/DD/YYYY"). You cannot compare text-that-looks-like-a-date to true dates.
The best option is to use =SCHEDULE!$C$2 in REF!B2 and format the cell as mm/dd/yyyy.
The bandaid (dig a hole then fill it up) is to adjust your COUNTIF to,
=COUNTIF(SCHEDULE!$C$9:$C29,">="&DateValue(B$2))

SUMIF with FIND as criteria

I'm trying to summarize data from several Google spreadsheet' sheets in a single one but I have some issues with SUMIF and FIND.
To Sum data from another sheet I have to use this (at least that's the only solution I've found)
=SUM(INDIRECT(""&A6&""&"!E2:E"))
Where I have the name of my sheet on A6.This makes everything easy because I have a column (A) with all the names of the sheets. I haven't found something like Sheets[1] in Google Docs.
My next step was to Sum Times from a specific column but remove a specific values, which in this case is 1 that get transformed internally 24:00:00 since it's a time column:
=SUM(INDIRECT(""&A6&""&"!D2:D")) - SUMIF(INDIRECT(""&A6&""&"!D2:D");"24:00:00")
Here I tried to do everything with a single SUMIF but I have no idea how. NOT("24:00:00") didn't work so I settled to this.
The last part is the most difficult and I'm not able to solve it.
I have a column with month names (for example) and I want to sum some data only when the month name contains "er". Here is what I thought:
=SUMIF(A6:A16,ISNUMBER(Find("er")),G6:G16)
This gives me always 0
(Note that the last one contains A6:A16 instead of the whole INDIRECT part because I am still testing it in a single sheet.)
Any Idea what I'm doing wrong?
I don't know why the above SUMIF doesn't work, what I've tested and works is:
=SUMIF(A6:A16,"*er*",G6:G16)
SUMIF is NOT SUM + IF as I thought. I hope it will help someone else.

Resources