I am in need of some help constructing an Excel formula that is capable of dynamically detecting the last cell with data in a column, in place of inputting a straight range such as C3:C38. The version of Excel I am using is 2010.
I have some screen captures of this spreadsheet that I've included here to illustrate what this spreadsheet looks like as well as specifics that might help in answering this question: http://staffweb.psdschools.org/mway/excelquestion/
Essentially this spreadsheet was something I constructed to help aide myself and colleagues in my building to construct a collection query in SCCM by inputting computer numbers in columns B. In Column C I have a CONCATENATE formula that adds a prefix to the adjacent value from the cell in column B.
The cells with the blue colored text are those where a colleague or I would enter text. The other, black (non-bolded header text cells), consists of formulas.
The spreadsheet uses a VBA macro to construct a custom concatenate function that takes a range of cells (C3:C35) and combines these into the SCCM collection query that we can then copy and paste into the SCCM program.
The custom concatenate formula used in cell C40 is: ="select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.NetbiosName = """&ConCatDelim(C3:C35,""" or SMS_R_System.NetbiosName = """)&""""
A piece that will vary from use to use, is the end-range of cells containing data in column C, as this will be dependent on how many computers need to be entered for a specific collection. This could be as few as 4 cells in column C entered or as many as 36.
As I will be sharing this with colleagues in my organization to also use I was looking to try and change the static range in the above formula (C3:C35) so that the end portion of that range dynamically corresponds, instead, to the last cell in column C with data, instead of being hard coded. This way my colleagues won't have to try and modify the range in this formula, less they inadvertently change something in the formula that results in an error.
If I simply make my end range a static C38 then I end up with added prefixes added to the formula in C40, due to the CONCATENATE formula that has been filled down to the bottom of the range (row 38) in column C.
Is there a way to change the cell range C3:C35 , in the above formula, out with another sub-formula so that it automatically detects the address of the last cell in the range? I've been researching and experimenting with this for a day or so but so far I haven't perfected a formula that gives me a proper result.
The other wrinkle in this is that column C does not contain any blank cells due to the CONCATENATE formulas that has been filled down in that column. However column B (which contains blank cells until a value has been filled in by a user) does contain blank cells and could be used to determine last cell containing data. Is there a way to use column B to evaluate the last used cell and then display the value of the adjacent cell (cell with the same row number) in column C? Would this be a MATCH or a VLookup formula?
Thanks much for your help with this!
Matt
I have some screen captures of this spreadsheet that I've included here to illustrate what this spreadsheet looks like as well as specifics that might help in answering this question: http://staffweb.psdschools.org/mway/excelquestion/
Essentially this spreadsheet was something I constructed to help aide myself and colleagues in my building to construct a collection query in SCCM by inputting computer numbers in columns B. In Column C I have a CONCATENATE formula that adds a prefix to the adjacent value from the cell in column B.
The cells with the blue colored text are those where a colleague or I would enter text. The other, black (non-bolded header text cells), consists of formulas.
The spreadsheet uses a VBA macro to construct a custom concatenate function that takes a range of cells (C3:C35) and combines these into the SCCM collection query that we can then copy and paste into the SCCM program.
The custom concatenate formula used in cell C40 is: ="select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.NetbiosName = """&ConCatDelim(C3:C35,""" or SMS_R_System.NetbiosName = """)&""""
A piece that will vary from use to use, is the end-range of cells containing data in column C, as this will be dependent on how many computers need to be entered for a specific collection. This could be as few as 4 cells in column C entered or as many as 36.
As I will be sharing this with colleagues in my organization to also use I was looking to try and change the static range in the above formula (C3:C35) so that the end portion of that range dynamically corresponds, instead, to the last cell in column C with data, instead of being hard coded. This way my colleagues won't have to try and modify the range in this formula, less they inadvertently change something in the formula that results in an error.
If I simply make my end range a static C38 then I end up with added prefixes added to the formula in C40, due to the CONCATENATE formula that has been filled down to the bottom of the range (row 38) in column C.
Is there a way to change the cell range C3:C35 , in the above formula, out with another sub-formula so that it automatically detects the address of the last cell in the range? I've been researching and experimenting with this for a day or so but so far I haven't perfected a formula that gives me a proper result.
The other wrinkle in this is that column C does not contain any blank cells due to the CONCATENATE formulas that has been filled down in that column. However column B (which contains blank cells until a value has been filled in by a user) does contain blank cells and could be used to determine last cell containing data. Is there a way to use column B to evaluate the last used cell and then display the value of the adjacent cell (cell with the same row number) in column C? Would this be a MATCH or a VLookup formula?
Thanks much for your help with this!
Matt