Excel - Find value of range when cell is equal to x - excel

I am trying to set up a expense tracker for my family for new years. I want to have the excel sheet give me a total for what i spent in cash, credit and check
I have a sheet set up similar to the following
I want to be able to at the end of the month see what i spent in
cash = 100.00
check = 12400.00
credit = 494.00
I have tried the following but they do not seem to work...
* =SUM(IF(C5:C42="Cash",D5:Z42))
* =SUMIFS(D5:D45,C5:Z45,"*CASH*")
* =SUMIF(C:C,"CHECK",D5:Z43)
Can anyone help me with this?
Thanks!

Or you can do it with a multiplication, so where J2 contains the payment method
=SUMPRODUCT($D$2:$G$7*($C$2:$C$7=J2))

If the payee is coulmn "B", then:
=SUM(SUMIFS(D:D,C:C,"check"),SUMIFS(E:E,C:C,"check"),SUMIFS(F:F,C:C,"check"),SUMIFS(G:G,C:C,"check"))
I modified for a table startingin coumn "B".

Related

If statment in Excel

Hy! Could someone help me out with this equation ? I looked onlyne for some solution but nothing could work :/
I am trying to figure it out how to calculate the following:
if anexe ( temporary higher work hours ) is greater then the contract hours, are equal to anex - worker hours( which i called uren )
I want so calculate a if statement more or less like this:
If Anexe > contract, is equal to Anex - uren
else Anexe < contract then contract - uren
Thank you for helping out already!
Above is a sample copy of your table with some random values between 0 and 100 filled in. I think the formula you want in cell D2 is:
=IF(C2>A2,C2-B2, IF(C2<=A2,A2-B2,0))
You can then copy it down to the cells below.

Excel CUBEVALUE & CUBESET count records greater than a number

I am writing a series of queries to my workbook's data model to retrieve the number of documents by Category_Name which are greater than a certain numbers of days old (e.g. >=650).
Currently this formula (entered in celll C3) returns the correct number for a single Days Old value (=3).
=CUBEVALUE("ThisWorkbookDataModel",
"[Measures].[Count of Docs]",
"[EDD_Report].[Category_Name].&["&$B2&"]",
"[EDD_Report_10-01-18].[Days Old].[34]")
How do I return the number of documents for Days Old values >=650?
The worksheet looks like:
A B C
1 Date PL Count of Docs
2 10/1/2018 ALD 3
3 ...
UPDATE: As suggested in #ama 's answer below, the expression in step B did not work.
However, I created a subset of the Days Old values using
=CUBESET("ThisWorkbookDataModel",
"{[EDD_Report_10-01-18].[Days Old].[all].[650]:[EDD_Report_10-01-18].[Days Old].[All].[3647]}")
The cell containing this cubeset is referenced as the third Member_expression of the original CUBEVALUE formula. The limitation is now that the values for the beginning and end must be members of the Days Old set.
This is limiting, in that, I was hoping for a more general test for >=650 and there is no way to guarantee that specific values of Days Old will be in the query.
First time I hear about CUBE, so you got me curious and I did some digging. Definitely not an expert, but here is what I found:
MDX language should allow you to provide value ranges in the form of {[Table].[Field].[All].[LowerBound]:[Table].[Field].[All].[UpperBound]}.
A. Get the total number of entries:
D3 =CUBEVALUE("ThisWorkbookDataModel",
"[Measures].[Count of Docs]",
"[EDD_Report].[Category_Name].&["&$B2&"]"),
"{[EDD_Report_10-01-18].[Days Old].[All]")
B. Get the number of entries less than 650:
E3 =CUBEVALUE("ThisWorkbookDataModel",
"[Measures].[Count of Docs]",
"[EDD_Report].[Category_Name].&["&$B2&"]"),
"{[EDD_Report_10-01-18].[Days Old].[All].[0]:[EDD_Report_10-01-18].[Days Old].[All].[649]}")
Note I found something about using .[All].[650].lag(1)} but I think for it to work properly your data might need to be sorted?
C. Substract
C3 =D3-E3
Alternatively, go for the quick and dirty:
=CUBEVALUE("ThisWorkbookDataModel",
"[Measures].[Count of Docs]",
"[EDD_Report].[Category_Name].&["&$B2&"]"),
"{[EDD_Report_10-01-18].[Days Old].[All].[650]:[EDD_Report_10-01-18].[Days Old].[All].[99999]}")
Hope this helps and do let me know, I am still curious!

How to use SUMPRODUCT using months and different criterion using Excel

I have a table that looks like the following:
Name Date Description
HallA 8/24/19 texttexttext
HallB 8/29/19 texttexttext
HallC 9/1/19 texttexttext
HallB 9/4/19 texttexttext
HallB 9/24/19 texttexttext
HallC 10/1/19 texttexttext
I would like to count how many times each Hall appears within each month.
This information should populate a table that looks like this.
Halls August September October .......
HallA 1 0 0
HallB 1 2 0
HallC 0 1 1
Additionally, it should be built to take more information.
I have been combining a solution to this from a number of resources, both of which are not correct.
=IF(SUMPRODUCT(--(MONTH($B$2:$B)=8)) - SUMPRODUCT(--($A:$A = "HallB")) - SUMPRODUCT(--($A:$A = "HallC")) > 0, SUMPRODUCT(--(MONTH($B2:$B)=8)) - SUMPRODUCT(--($A:$A = "HallB")) - SUMPRODUCT(--($A:$A = "HallC")), 0)
=SUMPRODUCT(((MONTH($B$2:$B)=8)))*($A:$A = "HallA")
I think I've been combining so many things to the point that I'm over complicating it...
Sometimes pivot table is a powerful tool in transforming data and here is one example:
Please make sure the dates are in Date format but not Text format otherwise pivot table will not be able to group the dates.
Cheers :)
Why do you need a sum product? I added a helper column with the months.
Month column = text(b2, "mmmm") filled all the way down.
Counter table = COUNTIFS($A$2:$A$7, F2, $C$2:$C$7, H$1)

Excel - averaging an n amount of rows based on condition in prior column

I have this table in excel:
Date value
1/2/1970 100.00
1/5/1970 99.99
1/6/1970 100.37
1/7/1970 100.74
1/8/1970 101.26
1/9/1970 100.74
1/12/1970 100.79
1/13/1970 101.27
1/14/1970 101.95
1/15/1970 101.97
1/16/1970 101.76
1/19/1970 102.21
1/20/1970 102.70
1/21/1970 102.00
1/22/1970 101.46
1/23/1970 101.49
1/26/1970 100.97
1/27/1970 101.45
1/28/1970 101.70
1/29/1970 102.08
1/30/1970 102.19
2/2/1970 102.02
2/3/1970 101.85
These are values that I have daily, and I need to construct a sheet that takes a monthly index of the daily values, example below:
date index
1/31/1970 some_index
2/28/1970 some_index
3/31/1970 some_index
4/30/1970 some_index
I could only get this far when it came to getting the index of 30 days:
=AVERAGE(INDEX(B:B,1+30*(ROW()-ROW($C$1))):INDEX(B:B,30*(ROW()-ROW($C$1)+1)))
I'm just not sure how to structure this in the most efficient, yet correct way possible. Not all months are the same amount of days, so I was hoping to check to get all the next n rows where the date starts with a "1" for example, sometimes certain days are also missing. I can't think of a catch all approach.
With 1/31/1970 in C1 try this,
=averageifs(daily!b:b, daily!a:a, "<="&c1, daily!a:a, ">="&eomonth(c1, -1)+1)
A PivotTable might be more convenient:

Excel: Change the value of a selected value from a validation list using vba?

I have a column with a data validation list in each cell.
Here is my list:
ND - No Delivery
SD - Short Delivery
OD - Over Delivery
Other
What I want to try and achieve here is if the user selects the value from the data validation list, then the cell changes to one of the following:
ND - No Delivery = ND
SD - Short Delivery = SD
OD - Over Delivery = OD
Other = Other
So my cells end up potentially looking something like this:
ND
SD
OD
Other
So if the user selects No Delivery, then the value in the cell is set to 'ND', and so on.
The only exception here would be other, which should still be set to other in the cell.
Here is a sample code to put it in to context:
If .Range("B1").Value = "ND - No Dleivery" Then
.Range("B1").Value = "ND"
End If
My validation for the cell should really only allow either 'ND', 'SD', 'OD' or 'Other' to be entered - but the list should contain:
ND - No Delivery
SD - Short Delivery
OD - Over Delivery
Other
Please can someone show me the best way to accomplish this?
Thanks in advance
Are there any visual and explain more, would be great if you can provide some sample?
On the selected cell that you want to reflect the selected option.
=IFERROR(IF(A2="No Delivery";"ND";IF(A2="Short
Delivery";"SD";IF(A2="Over Delivery";"OD")));"Other")
Tell me if this is the one you need.
Thanks
Sample- is it like this?
Excel Code

Resources