Excel: Reference row indicated by cell - excel

I have a sheet where each row is a month and columns are monthly numbers.
I made a separate sheet for each month where the numbers from each month can be pulled together and added up.
To do this, I've made a template for January and used references like: ='2019'!A8
I went through each month and changed the row number being referenced. ( ='2019'!A8 would change to ='2019'!A9 for the next month.)
Is it possible to pull the number for the reference from a different cell?
Could I have somehow referenced a cell which was just the number and used it for ='2019'!A#` Rather than change all my references by hand?

With a month indicator in each monthly sheet (say in D1 and 03 for March) then with all the monthly sheets grouped together my present understanding of what it is you want should be achieved with:
=INDIRECT("2019!A"&$D1+7)
(Don't forget to ungroup.)

I suppose your data look like:
Month Sales
January 500
February 1000
March 1500
... ...
Moreover somewhere on your monthly sheets I suppose the month will be written in a cell, say A1.
Then you could simply use the same VLOOKUP on all these sheets:
=VLOOKUP(A1;SALES_DATA;2;FALSE)
And if your monthly sheets name contain the month name in some way, you could even do something like:
=VLOOKUP(MID(CELL("filename";A1);FIND("]";CELL("filename";A1))+1;255);SALES_DATA;2;FALSE)
CELL("filename";A1) retrieves the whole sheet path like C:\Users\...\Desktop\[Sales.xlsm]March".

Related

Pull named range from cell value

I have a spreadsheet used to generate monthly job cards. I need to set it up so it "knows" which month it's on, and on which day number a Monday falls. To this end I have set it up that each day number for every monday this year is listed. Each line on the daily task jobcard is serial numbered from 1 to 28,30, or 31 dependant on the month, so I have set up a formula to check the serial number for the daily task against the day number of each Monday. It works and I have checked this, but the only issue I have is that the formula (=IF(COUNTIF(MARCH23MON,AJ6)>0,$AK$4,$AK$5)) requires me to change the MARCH23MON to match the range for each month up to 31 times every month.
Is there a way to do something like if the date = the date listed in cell a1, then use the value of cell b2 as the range (i.e. MARCH23MON).
See the screenshot here to see how I have begun to set this out. The date for each month is defined by the user in cell C3 when they generate the job cards for the upcoming month, this is then copied into cell AJ2 and formatted to match the dates in AP3:AP14.
I'd like to have the date defined in AJ2 to define the range the formula in AN6:AN36 uses from those listed in AO3:AO14, so that each month is checked against the relevant range of dates.
I had attempted to just use a vlookup then reference the output in this formula =IF(COUNTIF(MARCH23MON,AJ6)>0,$AK$4,$AK$5) as follows =IF(COUNTIF($AL$2,AJ6)>0,$AK$4,$AK$5) which obviously doesn't work. I tried it as ADDRESS($AL$2) but again no worky. Not sure if it is possible.
Foxfire and Burns And Burns mentioned the CHOOSE function in a comment, and that has resolved this for me. Instead of using the list of range names I am now using CHOOSE
to select the dates of each month's Mondays from individual lists. I get the value of AL2 from a VLOOKUP function.

Adding values to different cells depending on conditions - Excel

I am not very good with excel formulas, and I would need some help with a process I want to implement:
Simplifying things, I have an excel sheet (sheet n°1) with rows like this:
Company name | Price | Date
On other excel sheet (sheet n°2) I have one row for every company, and in each column there are all 12 months. I would need a formula so every time I add a row in the first sheet, the price I add is automatically added to the corresponding company row and in the corresponding month (based on the date) on sheet 2
I am really lost here, I know how to apply simple formulas, but not this, is there a way to add each value to a different cell depending on some conditions?
I forgot to add, that I would need to sum this values in sheet 2, so every time I add a new value, it is summed to the actual value of the corresponding cell.
I hope my english is not to bad, and thank you in advance!! :)
Use SUMIFS()
=SUMIFS($Q:$Q,$P:$P,$A2,$R:$R,">="&EOMONTH(B$1,-1)+1,$R:$R,"<"&EOMONTH(B$1,0)+1)
One caveat to this the month headers must be an actual date in the month desired. This can be formatted any way you want to display. My cells all contain the 1st of each month as their true dates.

Count the number of Sick Days (Denoted by "S") for each employee

so I have created a leaver tracker for our employees in an excel file.
Background: Each sheet represents each month (ie: Jan, Feb, Mar, etc.) which includes the following information:
** Note: This file is a template I downloaded from Google.
I have created another sheet which outlines the following: Note: these are sample data.
Question: What formula can I use to count the number of Sick Days (S), Annual Leavel (H) and Half Days (HA) separately for all 12 months across all sheets with 1 formula?
If I understand well, you can do this:
Without macro
Write a first sum formula in each sheet (after the last day)
In your Dashboard, write a sum formula from the previous sheet formula
or:
Write a marco to do it

Guide me Regarding Compare the Value of Cell contain date and other cell contain Drop down list

Hy Every One, I need help in excel formula, I have two sheets, sheet1 for sale tracker, sheet two for goals tracker, I used Now() to enter date automatically, and its working fine, Next in goal sheet, I use =Sumif() to calcualte various category totals and refer them in cell. Its also working fine. But I want to track record according to month and category. Like I have 6 categories detail is as under,
Sales Tracker
In the First picture Column Date consist of formula "=IF(ISBLANK(B5),"-",TODAY())" and it display the name of month like "October"
While in second picture there is a drop down list of "Month" Column.
1- I want to use if statement like =if(Date=Month, Sum(Revenue Secure column Data), "-") But its not working the formula I wrote here is an example....
2- I want when I select any month from second sheet like January, February, It should calculate sum from picutre one data and only show the sum of january etc.
Please help me, this is eating my brain a huge,,,,,,:)
Thanks in advance....
In short my question is how can I use If statement to compare value of cell that contain formula and other that contain drop down list?
Or use the MONTH function to change your date to a number 1 to 12 corresponding to the month. Then have the combo return a number for the month chosen. It might be faster using integers than test
I Believe you have to compare the month and not the whole date.
You can do TEXT(NOW();"mmmm") to get the full month name of the current data (in the language of excel) and then compare it to your drop down.
If you replace the NOW() with any data it works as well.

Replicating records in Excel

I have a set of rows in Excel which contain data for a particular month. The month is identified by a column called 'Month' and the data in this column is in the format mm/yyyy.
Now, I would like to duplicate these records vertically for each of the next 11 months, and each time it is duplicated, the month rows should change for that month (e.g. the second time it is duplicated, the month rows should show February and then the next time March, etc.).
What's the best way to do this apart from copy and pasting 11 times and manually changing the months?
The OFFSET approach needs only two formulas copied over to a new sheet to set up the extended data set
This sample assumes
your current sheet is called sheet1
your month data mm/yyyy starts in row 2, and is in column A
Changing the sheet name and column in the two formulas below is easy, if your data to extract started on row 3 not row 2 then change all ROW()-2) to ROW()-3) etc
While the first looks messier than it really is (to add 1 month), the concept is straightforward. The OFFSET approach moves down one cell from Sheet 1 only every 12 rows, the month being tweaked each cell
In A2 put, =DATE(YEAR(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)),MONTH(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0))+MOD(ROW()-2,12),DAY(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)))
In B2 put, =OFFSET(Sheet1!B$2,INT((ROW()-2)/12),0) and copy over as far as you have fields
Surprisingly enough, Excel 2007 (only one I have available) understands mm/yyyy as a date, so the formula =TEXT(DATE(YEAR(A2),MONTH(A2)+1,1),"mm/yyyy") creates the next date, and can be copied down.
Duplicating other data would simply be a case of putting the values as =B2 and so forth

Resources