Can I create a SUMIF with data from either of 2 columns? - excel

I am creating a budgeting table. I am using SUMIF (Category, "Category Name", Amount). However, I have 2 sets of "Amount" - Budgeted and Actual.
How do I make it in such a way that the SUMIF for that Category would add the data from Budgeted if the Actual field is blank?

Try this
check the ";" maybe you have to replace it with a ","
=SUMIFS(Amount;Category;SelectedCategory)+SUMIFS(Budget;Category;SelectedCategory;Amount;"")

Another way to do this is to have a column that represents the value to sum.
New column:
=if(isblank(Amount), Budget, Amount)
Then you just sumifs the new column by category.

Related

Return Value if 4 columns match in Excel

I have 2 sheets that I am working with in Excel:
1) Master Price Sheet
2) Entry
My "Master Price Sheet" sheet includes specific lumber dimensions and specifications as well as an assigned pricing (There are probably 200 different options available for pricing purposes so it takes a long time to manually look up each price)
When I am entering lumber lists into my "Entry" sheet. . .I'd like to return the value from the column "Price" from the "Master Price Sheet" only if the values in columns "Size (W)", "Size (H)", "Length", and "Species" entered into the "Entry" sheet matches columns in the "Master Price Sheet" so that it can find the pricing for me
What formula would be able to help me out with this?
Any help you can provide would be greatly appreciated
I've added images to this post below so that you can see what I'm working with
The easiest way is probably to create a helper column in both tables, where you combine the four cells with an ampersand & sign. This will create a unique key that you can use in a lookup function like VLoookup or an Index/Match combination.
For example: in the Master table, insert a new column before the price and in that new column use the formula (starting in cell G3
=A3&C3&D3&E3
Do the same in the Entry sheet table. Then you can look up the price like this in cell H3 of the entry table:
=vlookup(G3,'Master Price Sheet'!F:G,2,False)
Copy down.
This is the basic principle. You can add more refinement by error catching, so you don't get errors if rows are empty. One of many approaches would be to wrap the formula in an IfError, or check that all four cells have content before performing the Vlookup.

Excel PivotTable Count field as % of another Count field

I am using Excel from Microsoft Office 365 ProPlus.
Here's a really simple data table.
I want to build a Pivot Table around it to look like this...
... except that the "what I want" column (which is the count of items in Column C divided by the count of items in Column B) should be a part of the pivot table.
I have tried all sorts of things using calculated fields, calculations on fields, etc., to add the "what I want" column and just cannot make it work.
Can anyone help?
Calculated Fields only operate on the Sum of the elements in the data tables. Wherever you see a Field Name in the formula for a Calculated Field, picture it as meaning the sum of all elements for that field (that match any other row/column criteria in the Pivot Table).
Putting "= B / C" actually means "= SUM(B) / SUM(C)" for elements of columns B and C that fit that section of the Pivot Table.
The only way to achieve your goal is with two helper columns:
B Count: =COUNT([#B])
C Count: =COUNT([#C])
The sum of these columns then give you the count of columns B and C, so you can use these helper columns to give you what you want:
The Data Field based on the Calculated Field then says "Sum of What U Want", but it will always just be the result of your calculation, even if you change how the field is summarized through Value Field Settings. You can manually rename the Data Field, but it still needs to be different to the Calculated Field name you chose earlier.
Click in the Pivot Table, then go to the Analyze tab, click on Fields, Items, & Sets, then select Calculated Field. Your formula is probably
= B / C

Excel DAX function add value above in column

I'm trying to create a report that shows the current supply of incidents per week. I've got a table "Processing" with 5 columns:
"Year", "Week", "Created", "Closed" and "Supply"
The calculation I need to use is "Created"-"Closed" + "Supply" from the week before (the cell above). In a normal excel table this is easy enough but I can't figure this out with DAX.
To resolve your problem you have to create a index colum on your model. To create the index i create before a yearweek colum, with this calculate column formula:
=[Year]*100+[week]
After that i have create a Index Column with this calculate column formula:
=CALCULATE(COUNT(Tabella1[week]), ALL(tabella1), FILTER(Tabella1;[Yearweek]<=EARLIER([Yearweek])))
the result is this on powerpivot:
after that cou create a calculate column, with this formula:
= [created]+[closed]+LOOKUPVALUE([supply];[Index];[Index]-1)
the result is this:

Autofill column of an Excel table based on another column

I've created a table with multiple columns in Excel, and I'm trying to let it autocomplete some columns based on another one: There's an "Item name" column and a "Item type" one, and I want to make excel autofill the Item Type field on every row based on the entry in the Item name field on the same row, is there a way to make Excel handle this by itself based on previous entries?
EDIT: Example for clarity:
If I insert "Pizza" in Item Name and "Food" in Item type, when I enter "Pizza" again in another row, Excel auto-fills the same row "Item type" field with "Food"
Based on your edit you want the vlookup function.
VLOOKUP( value, table, index_number, [not_exact_match] )
If index_number is less than 1, the VLOOKUP function will return
VALUE!. If index_number is greater than the number of columns in table, the VLOOKUP function will return #REF!. If you specify FALSE
for the not_exact_match parameter and no exact match is found, then
the VLOOKUP function will return #N/A.
But first you'll need to make sure that these associations are already present. You need a table like this. Assume that 'object' is a1 and 'type' is b1:
Object Type
Pizza Food
Car Vehicle
Now for your table that you're entering the values, assume that 'name' is d1 and 'type' is e1:
Name Type
Pizza =vlookup($d2, $a$2:$b$99, 2, false)
Car =vlookup($d3, $a$2:$b$99, 2, false)
The '$' will prevent the relevant cells from changing if you use autofill to complete the column.
If this is a set list that is relatively short you can manually enter it into the autfill options.
Microsoft gives you all the various ways to do this.
https://support.office.microsoft.com/en-us/article/Fill-data-automatically-in-worksheet-cells-74e31bdd-d993-45da-aa82-35a236c5b5db?CorrelationId=99c7dec0-4c5c-4988-b148-6d3b7c4dd2e5&ui=en-US&rs=en-US&ad=US
Also, creating a pivot table may be what you want to do. Simply highlight your main table and go to the insert table and click pivot table. Move the headers into the appropriate box.
The last option may be your best bet if it involces a ton of values. lookup/match functions will give you a more robust formula that is more versatile.
If you can give a sample set of data and what you want it to look like I can give you the formula.

Selecting the max with a condition in excel

I have a range in excel with dates and values
http://lh4.ggpht.com/_i-hI_3gfy08/SoSIopeZUZI/AAAAAAAABEk/KjFnq57VTUc/table.png
EDIT:image added
I want to select the MAX value from the HIGH column for each YEAR (2009 would return 404, 2008 would return 390)
I've done something similar but it's using SUMIF, not MAX.
Any excel people in here that can help me out?
The equivalent of SUMIF in Excel is something like this:
{=MAX(IF(CategoryColumn="High",ValueColumn,"")}
Where
CategoryColumn is the column containing your categories (e.g., "Low", "Med", "High")
ValueColumn is the column containing the data you want to get the max of
NOTE: This is an array formula so you must press Ctrl-Shift-Enter when entering this formula instead of just Enter. Also, don't actually type in the braces {}. The braces show up automatically to indicate that you've entered an array formula.
NOTE 2: You can actually name a range of data. For example, select the range A1:A20. Right-Click and select "Name a Range..." So, for this example, you can select your category column and name it CategoryColumn. Same with ValueColumn.
Array formulas allow you to do IF statements and other functions on a whole range of data instead of just a single value.
This example checks if the value in the "category column" is "High". If it is, it puts the neighboring "value" into the MAX function, otherwise it puts a blank. This gives you the maximum of all the "High" values.
P.S. I don't think the img tag works on this site...can't see your image.
There are three options available.
My preferred option is to create a pivot table without a helper column.
Option 1: Use a pivot table
Create a pivot table of your data.
Set the row to the date field and group it by year.
Alternately a 'Year' helper column could be used by adding a column with this formula.
=YEAR(A2)
Set the data items value portion of the pivot table to be the MAX of your 'High' field
Option 2: Use the DMAX function
Add a helper column titled year with the formula
=YEAR(A2)
Then add a formula for each year
=DMAX(A1:C21,"High",F13:F14)
Option 3: Use an array formula
Enter an array formula for each year using the Ctrl-Shift-Enter keys.
{=MAX(IF(YEAR(A2:A21)=2008,B2:B21))}

Resources