using sumifs from multiple sheets in one work book - excel-formula

i have an excel workbook to keep track of expenses with several tabs. all tabs have identical columns : A - store, B - type, C-amount, D-date. on a new sheet i want to sum all expenses for each type and each month. (example: type food for Jan. type car for Jan. and same for Feb. etc.

You seem to have the consistency required for a 3D formula. Group your sheets and write the SUMIFS formula you require for that sheet in one sheet (or ungrouped, write in one sheet and copy to the same cell in each of the other sheets). Then ungroup (if grouped) and aggregate these results in a sheet of your choice with something like:
=SUM(a:z!J2)
where a is your first sheet's name, z your last sheet's name and J2 represents whatever cell you chose for the SUMIFS formula.

Related

Is there a way to change the formulas in my Excel sheet that reference another worksheet based on the date?

I've spent hours pouring through posts using VBA, VLOOKUP, INDIRECT, etc. but haven't had much luck for this specific situation and just ended up making myself more confused.
I'm essentially doing a daily financial report. I have two worksheets. The first is "Summary" and simply gathers all the data and numbers from the day's sales and presents them neatly. The second worksheet is "Weekly" and this is where I'll input direct values into cells every day (e.g. Items Sold, Retail Shipping Cost, Total F&B Sales today).The "Weekly" worksheet has each date of the month in columns so, for instance, all the numbers for the 3rd of whatever month are input manually by myself under Column D. All the numbers for the 4th of the month are input into Column E.
The first worksheet is essentially just listing these values again more neatly or occasionally totaled up into larger sales categories which leaves me with a long column of cells in "Summary" containing formulas like "Weekly!F8" "Weekly!F10-Weekly!F3" that I have to change every day to reference the next date's numbers (e.g. Weekly!G8" "Weekly!G10-G3"). I've been using Search and Replace so far to search for "Weekly!*" and replace with "Weekly!next letter of alphabet" but I'm looking for a different solution.
Summary - https://i.imgur.com/6KqiyY8.png
Weekly - https://i.imgur.com/R8eafum.png
Is there a way to automate this so that the cell formulas change to reference the following column in another worksheet depending either on the date or a reference cell that contains an integer denoting the day of the month. I could change that one reference cell value manually and ideally have the whole column of reference formulas update as well.
You can use the OFFSET() worksheet function. For example in your first image, the highlighted cell's formula will become =+OFFSET(Weekly!A10,0,$A$1) where cell $A$1 is the reference cell that contains the day of the month.
A better approach than using OFFSET() in all your formulas is to add a column at the end of your "Weekly" worksheet and call it "Today" for example. Use the OFFSET() worksheet function in all cells of this column. Then you can reference only this column in your "Summary" sheet.
Example: In your "Weekly" worksheet use "AG" column as "Today"'s column. Then the formula of "AG10" will become =OFFSET(A10,0,$A$1) and the formula of the highlighted cell in your first image will simply become =+Weekly!AG10

Excel dynamic array formula

I have a workbook with 11 sheets for each month, and one summary sheet.
On each sheet is a list of website in column A between A2 and A13, and in column B are some values taken from those website.
The individual Month sheets look something like this:
HOWEVER, it is possible that the information may be in a different order, so I have had to use MATCH to find the row where I want to get the data from.
The summary sheet looks something like this:
I want to build a formula that will sum all the values across the 11 worksheets for each website.
I tried to use INDEX and MATCH like this:
=INDEX(January!$A$2:$B$12,MATCH($A3,January!$A$2:$A$13,0),2)
Now this works for January and copies down for all the web-sites ok, but I'd like to SUM all the worksheets without adding the formulas?
How can I do something like this across all the worksheets?
It seems a bit naff to just add a plus sign and write eleven formulas in each cell
Create a named range (eg) SHEETS containing your sheet names (in a column)
In B3 on your summary sheet:
=SUMPRODUCT(SUMIF(INDIRECT(SHEETS & "!A2:A11"), A3, INDIRECT(SHEETS & "!B2:B11")))
and fill down

Drag down Series

I have an Excel workbook with multiple Sheets month wise(i.e Jan, Feb, March).
Data are arranged like
January in separate sheet and February in Separate sheet.
Now in summary sheet I would like to add = JanA3+FebA3+MarchA3
And the next entry in summary will be = JanA6+FebA6+`MarchA6
When I drag that formula in Summary Sheet, it is not coming automatically.
You can't tell excel to change the reference by 3 rows when you only move the formula one row.
You can write a macro to do this or you can fill the formula down until you get the result you want and then delete the cells between and shift the cells up. The reference will remain as you want.

How to input two arrays in VLOOKUP?

I have a worksheet in Excel 2013 with two sheets: Sheet 1 and Sheet 2. I am applying a formula in both the sheets in the same column (G). The data is in more than 100,000 rows that's why I can't put it in one sheet only.
The problem is that I want to use VLOOKUP in both sheets in a way that the function looks up in both sheets in the same columns (arrays) i.e. A and B columns in sheet 1 and sheet 2 and get the value from column B i.e. column 2 within VLOOKUP function.
How can I add reference to the other sheet?
I doubt a complete solution is possible with VLOOKUP because, for instance, the corresponding ColumnB values may differ even where a ColumnA value is the same on both sheets. So without VBA (or possibly merging your sheets) you may have to compromise, so I offer only a partial solution, based on Excel 2007.
This 'looks up' in the 'other' sheet and only defaults to the 'same' sheet where the first attempt is unsuccessful. It uses INDEX and MATCH because likely quicker than VLOOKUP for high volumes. The formula I have applied for Sheet1 (in G1 and to be copied down) is:
=IFERROR(INDEX(Sheet2!B$1:B$6,MATCH(E1,TwoArray,0)),INDEX(B$1:B$7,MATCH(E1,OneArray,0)))
where the OneArray and TwoArray are named ranges for parts of ColumnA for the two sheets and the link values are expected in ColumnE (the formula in Sheet2 is similar):

How to match terms from multiple columns to one column using VBA

I have Sheet1 of User ID's associated with multiple terms. The terms are listed in separate columns. There are up to 30 terms for each user. The sheet is organized as User ID in column A and Terms in Columns B,C,D, etc.
I then have a series of Terms associated with a unique Categories in Sheet2 (Term in column A, Category in Column B). The goal is to match up users with categories. So, I need to perform a Vlookup of epic proportions or run a VBA program that compares the terms in columns B,C,D, etc in Sheet1 to the Terms in Column A in Sheet2.
If found in Sheet2 it would be great if the formula replaced the term with the associated category in Sheet1.
Create a sheet3
paste the following into sheet3, cell A1:
=iferror(vlookup(sheet1!A1,sheet2!:$A:$B,2,0),sheet1!A1)
Then drag down and to the right for as many rows / columns that were in sheet1.
Essentially, the formula will lookup whatever is in each sheet1 cell in the sheet2 list. if it's found it returns the value and if it isn't it just shows what was on sheet1.
Update
If you have an older version of excel that doesnt have iferror you can use iserror like this:
=if(iserror(vlookup(sheet1!A1,sheet2!:$A:$B,2,0)),sheet1!A1,vlookup(sheet1!A1,sheet2!:$A:$B,2,0))

Resources