I have got a spreadsheet with a database of people and all their details, Surname (E), Name (F), Gender (L), Date of Birth (M), Age (O), etc...
So I have a demographics sheet that I calculate ages, gender etc and would like to do the following 2 tables.
1. Working out ages between 2 specified ages that I input into set cells. E.g. I want all people between the ages of 13 and 18 years old (So i put 13 into cell A13 and 18 into B13. My formula will then sit in C13 and will Also count those ages. I want to do this so to be able to change the ages if needed
2. Working out Surnames that sit between an alphabetic range. So as I did with ages I can have "A" into A51 and "D" in B51 and it will give me all the surnames that start with those letters in a range between A and D (Including the 2 options I have in those cells).
I've normally just dynamically selected a range using the xldown feature but because this row contains formula it goes always down to the bottom of the formula instead of the last cell which isn't blank.
How would i go about generating this dynamic range that stops at the first cell that contains no value (but has a formula)? Perhaps a do while loop which looped down until it hit the first blank and then assigned the cells it had looped through as the range?
I would like to ask if it is possible to sort a range of row? What I mean is, if I sort like Row 1, the entire block of row 1 will move as well? Like if i have column A to F, then row 1 of column A to F will move together at the same time.
I was just recently forced to create my first UDF and after how well it worked I now am very interested in learning more. I am trying to create a function to sort a range by the values in a specific column and return the range. I know this should be really simple but for some reason my code dies whenever it gets to my inner-most loop. I need to use this in a larger function but for now this is my only question. I did find that Excel 2007 has built in Functions for this but my company still uses 2003.
My Public Function SortRange(rngToSort As Range, valCol As Integer) Dim Swapper As Variant Dim i As Integer, _ j As Integer, _ k As Integer
For i = 1 To rngToSort.Rows.Count For j = 1 To rngToSort.Rows.Count - i If rngToSort(j + 1, valCol) < rngToSort(j, valCol) Then For k = 1 To rngToSort.Columns.Count Swapper = rngToSort(j, k) rngToSort(j, k) = rngToSort(j + 1, k) rngToSort(j + 1, k) = Swapper Next k End If Next j Next i SortRange = rngToSort End Function
How would one go about creating a macro that would sum values in column G based on a condition in F ( a "SUMIF" basically) until the end of the range?
The condition would be so that the first blank cell in Column G (starting from column G9 ie Range("G9").End(xlDown).Offset(1,0) would contain the sum of everything above up until the word "Total" (or even the string of 5 characters from the left say "Total") appear in Column F - (the word Total appears a few times in column F, so it should detect the first applicable one)
The idea would be to have this repeated / looped until the end of the data range
Attached is an example and I hope what I have written makes sense
As for the worksheets:
"Final" is what it should look like (Blue Cells represent manual calculations)
"Working" Sheet is where I have it up to now
The sheet "Original" has a button that recreates everything up until where "Working" Sheet is
I have a problem with a very simple Lookup (please see attached). When I copy/drag down the dropdowns in column A and the Lookup formula in column B, the lookup up does not recognise the value in column A till I save the sheet. The same if I select a different value from the dropdown i.e. the lookup only works when I save the sheet. Am using the wrong Function to do this or it something else.
I've uploaded my spreadsheet. I asked my professor if our formula had to take into account whether or not our payment would be changing. As long as I calculated the initial amount - which worked out to be around 30 dollars, I could assume I paid that amount for the entirety.
My latest Mastercard statement shows a balance due of $1,696.96.
Based on recent bills, assume that the minimum payment amount is computed as follows
(balance_owed)*(annual_interest_rate/12) * 2, then rounded to the nearest whole dollar amount.
The minimum payment amount is the amount calculated above or $25.00, whichever is the greater amount.
The annual interest rate for purchases is 11.24%. If I make no more purchases and always pay my bill on time how many years and months will it take be pay it off at the current minimum payment amount each month?
How much total interest would I pay if I repay the loan this way?
What fixed monthly payment amount would pay off the debt in 2 years?
Assume monthly compounding of interest. All calculations are to be done in the Excel worksheet.
The functions NPER() and PMT() will be useful. Note that either the Present Value or Payment amount should be negative (not both) because of conventions concerning the direction of cash flow."
This is part of the bigger excel sheet. I would like to write a macro to find the column D6 based on the location of text 'committed total' . Then addup all numbers from E6 to V6 and write total in W6. Then add d6 and w6 and place it in X6.
I need a formula to sum all E3 cells starting from sheet "Joe" to the last sheet i have, without being obliged to modify the formula for each new sheet i create and which by default is created in the end. something like: =sum(Joe:my last sheet created!E3)
Also,do protected cells in some of the sheets affect this formula calculation?
can i use the countif question to make it count till a particular row based on the value . for instance if i want the countif till value 45 is met i.e i want countif to count till the row where 45 value is housed
I have a control chart macro which is being used for patient doses of a medication. Right now my macro automatically fills columns D-N down to row 100. However, I would like it to stop at the last row of data entered in column A. I have attached the code related to the formulae a
VB: Sub autofill() Range("A1").Select Selection.autofill Destination:=Range("A1:A1048576 "), Type:=xlFillDefault End Sub
but i need to select first cell in every 20th column and then execute autofill till the last row that excel provides. I can only do this manually but I have for now 125 columns to fill or to write some monstrous code. Unfortunately I do not have the knowledge to do this in a smart way and I guess there is an elegant way to solve this problem.
Dim MyData As Range Dim MyResult As Range Set MyData = Range("E1:E1000000") Set MyData2 = Range("F1:F1000000") Set MyResult = Range("J4") MyResult.Select Selection.Formula = "=COUNTIFS(" & MyData.Address & ",""=Kim""," & MyData2.Address & ",""=done"" )"
Is there any way I can change the code so that it automatically finds the last cell as Im using Range("E1:E1000000") and Range("F1:F1000000") because there will not be more than 1000000 entries.