Combining If, Offset And Range Of Cells
Feb 13, 2007
i need to get an equation correct for a scheduling application
assume $f24 is a task frequency and U24 is our current cell location
=IF(OFFSET(U24,0,(-$F24+1),1,($F24-1))"","","X")
i am asking if (the range of cells to the left of current cells (range being task frequency -1 columns wide) are empty - and if so - put an x - if they are not empty - then leave it balnk.
i can get it to to work for a 2 weekly schdule but need it to work upto 52 weeks
i have a simple spreadsheet with the problem clearly defined for anyone who can help
- beer in it for anyone who can help - or can pay via paypal if required
View 9 Replies
ADVERTISEMENT
Oct 25, 2013
I roughly know what my equation should look like, but it keeps failing. Its all part of a wider spreadsheet but I will only put down that bits that impact this part of the sheet.
In my cell I need it to input a value from a different spreadsheet. The input value is text.
I currently use this formula and it works perfectly for what I need.
=(OFFSET(INDIRECT("sheet2!D"&$A7),R$6,25,1,1))
This would a return a variety of results such as "excluded","compliant","non-compliant".
I would like to arrange an IF function so that if the answer is Excluded to keep it as Excluded. But anything else to use this formula instead.
=(OFFSET(INDIRECT("sheet2!D"&$A7),(R$6-2),25,1,1))
View 3 Replies
View Related
May 13, 2013
On Sheet 2 I am looking for a formula to find Dog1 in a cell on a different sheet and then to equal a cell 2 columns to the right of where ever it found Dog1. I cannot make it so that it simply equals a certain cell all of the time. It has to be able to move in sheet 1. For example sometimes Dog1 will be on row 5 and sometimes it will be on row 7. So the equation I am looking for needs to be able to work no matter what row it is on. I have tried a couple VLOOKUP equations but they are not working because like I said, Dog1 is not the only text in that cell.
View 3 Replies
View Related
Feb 7, 2013
How do I offset a range of cells?
I'm running simulations. Let's say I want to run the "for" loop 100 times. In the 1st iteration I want to copy Range(A1:A10) and paste the value to A31:A40 (this destination range is fixed for each iteration). In the 2nd iteration I want to copy Range(B1:B10) and paste to (or assign value to) A31:A40. In the 3rd iteration I want to copy Range(C1:C10) and paste to (or assign value to) A31:A40. And so on for 100 iteration. So each time my copied range moves one column to the right.
How do I achieve this in VBA code? Let's say I have defined/named Range("A1") and want to keep offsetting to the right but copying 10 cells in the range as I go along.
View 6 Replies
View Related
Mar 29, 2013
I have a table that is 10 columns wide. On a separate worksheet I want to display the last 10 rows of the table - 100 cells in all.
Getting the value of one of the cells is easy enough - I used:
=OFFSET(DataTableFirstCell,COUNTA(Sheet2!$A:$A)-1,0)
If I copy/paste, or drag the fill handle to expand the target range I end up with the same formula and same value in all 100 target cells. I know I can edit each cell to modify the offset -1,-1, then -1,-2 then -1,-3 etc but that's mind-numbingly tedious and likely to introduce error.
There must be a way to have a cell reference another, then copy the formula to adjacent cells and and have the result show the content of cells adjacent to the original source.
I've been trying INDIRECT and INDEX with ROW and COLUMN - but I can't work it out.
View 9 Replies
View Related
Dec 17, 2013
I have some data A2:A1000 where there is a start date in column D and end date in column E (formatted DDMMMYYYY). In column F I have a formula that calculates the NETWORKDAYS between the dates.
What I want is a set of formulae that will look in column D for a date between 01/01/2013 and 31/01/2013 (or any date I specify) and find the 'MIN', 'MAX' and 'AVG' of the values in column F where the date in column D matches my criteria.
What I can't figure out is how to offset from the cells matching the date range!?
View 1 Replies
View Related
Oct 16, 2006
Sub TestSearch()
Dim FoundCell As Range
Dim SearchString As Variant
'Specify Value to Search
SearchString = " Excel"
'Perform the Search and Return a Cell Value
Set FoundCell = Worksheets("Source").Range("A1:A10000").Find(" Excel", lookat:=xlPart)
If Not FoundCell Is Nothing Then
MsgBox "Found at " & FoundCell.Address
End If
End Sub
I'd like to take the code above, which returns a cell address which contains the text " Excel" and modify or add to it the capability to copy a range starting from the address returned and ending 102 cells further down in Column A on the Source sheet to A1 of the Sheet1 sheet. The crux of the problem seems to be converting the address to a row number then adding the value of the number of cells in the range to find the end row number then converting that back to an address??
View 5 Replies
View Related
May 23, 2012
What can I add to the macro I already have in place (below) to accomplish what I'm looking for (2 parts)? ...
1) I need to copy everything (formulas) that is in C7:F7 and paste it down to all "active" rows - I'm defining an active row by any row where column A is not blank.
2) I need to copy everything (formulas) that is in Q7:AF7 and paste it down to all "active" rows - I'm defining an active row by any row where column P is not blank. (You'll notice by the screenshot that there will be blank cells in column P mixed in with non-blank cells.)
Code:
Sub AdminTool()
'
' CreateAdminTool Macro
'
'
ActiveWindow.Zoom = 90
Rows("1:1").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
[Code] ...........
View 7 Replies
View Related
Sep 16, 2009
I recently had a query about pulling data from different closed workbooks using a concatenate to easily choose the file:- ....
View 6 Replies
View Related
Sep 28, 2009
I know a simple formula would 'almost' do what i want...but i was hoping for a simple feature....
i have several text cells that i want to combine into one cell.....
so a formula like =A1&B1&C1.... would work fine....but is there anyway to present this data a little fancier? for example separating each cell entry after a "break" or something....
View 9 Replies
View Related
Jun 16, 2014
I am trying to create a macro to gather a data range from multiple files placed a folder and combine them into a single worksheet which can be easily totaled. I've used some similar code I did for another project to gather the data. It starts by listing the file name and then the data set (About 40 cells) below the file title. However, the data sets from each spreadsheet are filling themselves into a single column one after the other, whereas I would like to have them populate one worksheet's data in each column.
[Code]......
SummaryWorkbook.xls
View 1 Replies
View Related
Apr 29, 2009
I have two columns, Brief Descriptions and Detailed Descriptions. In many cases they are different and I combine the two for one longer description; however in certain instances the two columns read the same. Is there was way to combine the two cells where any repeat text is only expressed once?
View 3 Replies
View Related
Dec 29, 2009
I'm trying to combine 2 cells: 1/1/09 and ABC. However, when I combine them the date keeps changing to a number. Is it possible to keep the date format?
View 2 Replies
View Related
Sep 17, 2009
I am trying to combine multiple cells into 1 cell per row.
I would have "A" column empty, then combine "B", "C", and on into the "A" column.
Each cell value will be separated by a space or any special character I designate in the macro
I have attached an example which the output is separated by a space. Sheet1 has the original file and Sheet2 has the desired output.
View 9 Replies
View Related
Feb 13, 2009
I'm looking to take words which are originally in their own separate cells and "combining" the words all into one single cell.
Is there a function that will be able to do this for me?
View 2 Replies
View Related
Jul 27, 2009
I have a list of dates in column A as follows:
11/1/2015
5/1/2012
8/8/2013
10/22/2015
4/1/2014
4/15/2014
In column B I have set of data as follows:
C 2010@101.0
C 2011
C 2011@101.0
C 2012@101.0
C 2013
C 2013
C 2014@101.0
I need to combine the day and month only in column A with the year (in positions 3-6) in column B
As an example I have "11/1/2015" in column A and "C 2010@101.0" in column B. The desired result in column C is "11/1/2010".
I have tried using the left function in column A with the mid function in column B but haven't had any luck so far.
View 2 Replies
View Related
Jan 11, 2010
I am combining information from two different cells to one cell using cell reference such as,(=B4&"/"&F5),B4 being a number and F5 the date. So my question is how to get the date to show as a date value and still have the other value remain unchanged. I have tried to use formating but will not work to keep the date. An example would be
View 2 Replies
View Related
Apr 17, 2006
I have a spreadsheet with a name spread over 3 cells
A1 = MR
B1 = JOHN
C1 = SMITH
i want to create a macro or a formula that combines all of the data in these cells into the first column so that in column A1 it would read MR JOHN SMITH.
View 5 Replies
View Related
May 9, 2007
I want to combine cells from two adjacent columns in this way: a1 is combined with everything in column b, then a2 is combined with everything in column b, etc. So that I have a1b1, a1b2, a1b3, a1b4, a2b1, a2b2, a2b3, etc.
View 9 Replies
View Related
May 16, 2009
I am having trouble with one line of this code that I can't figure out how to write correctly. I have set the range, but I need to offset by 10 rows up. My code fails at set rng.
View 6 Replies
View Related
Sep 29, 2009
I have an offset range ("TheCell") that does not seem be working how I would expect.
I don't know if its because the sheet I am working on was originaly German but I would be surprised if that was the case.
I Use sheet change to set the peramiters of the range and to test the value
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rowcell
Dim colcell
Dim typeit
colcell = ActiveCell.Column
rowcell = ActiveCell.Row
ActiveWorkbook.Names.Add Name:="iname", RefersToR1C1:="=" & "Tabelle2!R1C" & colcell
ActiveWorkbook.Names.Add Name:="Jname", RefersToR1C1:="=" & "Tabelle2!R" & rowcell & "C2"
typeit = Range("TheCell").Value
MsgBox typeit
End Sub
=OFFSET(Tabelle1!$B$4,MATCH(Jname,Tabelle1!$B$5:$B$57,0),MATCH(iname,Tabelle1!$B$4:$EX$4,0)-1)
but for some reason I am getting a runtime error 1004 worksheet failed.
I have used this technique before and its been fine so what mistake have I made :o)
View 9 Replies
View Related
Aug 24, 2006
I want to apply some logic to a range. However I want to offset the bottom of the range by 1 row.
Example: I have a range (B8:I19) already defined in my vba code. But I want to shade range (B8:I20).
MyRange = Range("B8:B19")
MyRange.Offset(1, 0).Interior.ColorIndex=3
This code also offsets the top of the range (row 9), which I don't want.
How can I only offest the bottom of the range?
View 5 Replies
View Related
Jan 30, 2013
I am setting up a new chart of accounts, with the format xxx-yyyy, where xxx is a three digit department number, and yyyy is the expense account. I am building a spreadsheet to populate the new chart of accounts to be uploaded into our accounting software. I would like to have a cell that takes the xxx from one cell, adds a hyphen, and combines it with the yyyy value. The result would be xxx-yyyy format.
View 3 Replies
View Related
Nov 21, 2013
I have the below data that I need to concatenate, merge... I'm not sure.
The data looks like this currently:
So that it reads in one sentence, e.g. Northumberland; Newcastle; North Tyneside; South Tyneside (note - no "." or ";" at the end of the string).
I had come up with this formula -
=IF(A11>0,A11&"; ","")&IF(B11>0,B11&"; ","")&IF(C11>0,C11&"; ","")&IF(D11>0,D11&"; ","")&IF(E11>0,E11&"; ","")&IF(F11>0,F11&"; ","")&IF(G11>0,G11&"; ","")&IF(H11>0,H11&"; ","")&IF(I11>0,I11&"; ","")&IF(J11>0,J11&"; ","")&IF(K11>0,K11&"; ","")&IF(L11>0,L11&"; ","")&IF(M11>0,M11&"; ","")&IF(N11>0,N11&"; ","")&IF(O11>0,C11&"","")
Which works fine if there is a value in cell O, but if not, then a semi-colon appears at the end of the string. It also seems incredibly clunky.
Basically, I'm struggling (being a total n00b) to get the semi-colons in the right place, blank cells to be skipped or not included, and for there to be no semi-colon after the last value.
View 4 Replies
View Related
Mar 4, 2014
I currently have a column with each cell containing alphanumeric data of a filename.
The majority of cell data looks something like this.
"AB_XYZ_0408_00700.doc"
"AB_XYZ_0408_00708.doc"
"AB_XYZ_0408_02200.doc" etc
**Note the numbers "00700" are always 5 digits long also note the extension is always ".doc" (4 characters long). However the other parts, AB_XYZ etc vary in length based on the worksheet.
I need to ADD or Subtract "+1" or "-1" from the 5 digit number for example make "00700, into 00701"
I currently tried to separate the data into columns which provides me with the number 00700 isolated in its own cell and then I simply add or subtract 1. In that isolated cell I am able to add "leading zeroes" and it works great.
The Problem is that when I combine the separated cell data "=A1&B &C1" with the New number (in this case 00701") the problem that I run into is the leading zeroes do not follow over to the combined cell and I am left with a final filename like this "AB_XYZ_0408_701.doc" - That is missing the leading zeroes.
Also if you have a more advanced formula that could simply add and subtract "1" from the 5 digit number that would be ideal.
View 2 Replies
View Related
Nov 4, 2009
I have the following setup,
Down column A I have a list of jobs, job 1 , job 2 etc
Down column b I have either a blank cell or other data (will be numbers but is irrelevant)
What I want is a formula for a cell that tells me which titles in column A have any data at all in column b. I need it to look like the following : Job 1, Job 2, Job 4
assuming b1 b2 and b4 have any contents and b3 and b5 and onwards are empty
I am seeing that concentate gives me close to what I want but the number of rows in column a and b change constantly and also may be above 30
View 9 Replies
View Related
Aug 10, 2006
I am generating a calendar view of project information in excel with the column headings as dates. Every project should be a merged group of cells spanning the rows for the proper dates.
Right now I generate a new row with new merged cells for every project (100 projects = 100 rows, even if the project only spans a single day!)
I need to be able to consolidate the project data so that if two projects' dates don't overlap they are put in a single row.
For instance:
Project 1 runs 8/2/2006 - 8/3/2006
Project 2 runs 8/5/2006 - 8/9/2006
Project 3 runs 8/6/2006 - 8/7/2006
Right now I get 3 rows, each with one piece of data shown as a group of merges cells.
I want to see Projects 1 + 2 or 1 + 3 on the same row (since they don't overlap).
Simply cutting and pasting up doesn't work because the vba automatically overwrites data.
I just don't know excel vba very well (long time access man).
View 9 Replies
View Related
Aug 29, 2008
I would like to work with a range of cells.
I have a headerCel (A2)and a footerCel (A20).
If I use the line
View 9 Replies
View Related
Dec 8, 2008
I am currently writing some VBA code to loop through and copy data from Excel file in sub folders into a master sheet of data. There are some 1200 Excel files (these are pre-2007 files), each containing a maximum of 600 lines of data. So far the code works until it gets to around 65000 rows (the old Excel limit). I am using and writing the code in a Macro-Enabled Excel 2007 file.
I am using a Range.Offset call, which is where the error is occurring, to copy in a name basically. What happened right before this was a Range.Copy operation from the old Excel file to a Range.PastSpecial in the new one. This worked fine, and actually went a few hundred rows past the pre-Excel 2007 limit. But when the single cell operation Range.Offset().Value is called next, it crashes with a Application or User-Defined error. The code works some 100+ times through the loop with no problem, and the file that it was working on is no different then the other files.
View 9 Replies
View Related
Jan 28, 2009
I am trying to create a macro that goes down Column A of my sheet and looks for a string, "Number". When it finds it, it resize (0, 14) and cuts. Then it pastes the array at an offset of (-1, 10) This is what I got so far:
View 4 Replies
View Related