I have a client data set I am struggling to organise. I was previously helped on here with a question on how to split a cell with words that had been formatted with no space. This worked successfully for the names of clients but now my data is a little more tricky in regards to their job title and company name as the variables are so different for each cell.
For example;
Cell 1 - First Name
Cell 2 - Last Name
Cell 3 - ManagerCompanyName
or
Cell 3 - Principle ManagerCompany Name
My problem is with cell 3 and the spacing. I would like it to be as:
Cell 3 - Manager
Cell 4 - Company Name
Is there any way of doing this without manually adding the spaces?
The code for seperating first and last name was:
=SMALL(IFERROR(FIND({"A","B","C","D","E","F","G","H","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"},A2,2),""),1)
and then
=MID(F2, (G2), 60)
I presume it is similar, however the inconsistancy is making me struggle.
Thank you
=LEFT(A2,IFERROR(SMALL(FIND(CHAR(65+SEQUENCE(26,,0)),A2,2),1)-1,LEN(A2)))
Can be used to get the first word up to the next capital.
=IFERROR(MID(A2,SMALL(IFERROR(FIND(CHAR(65+SEQUENCE(26,,0)),A2,2),""),1),LEN(A2)),"")
To get the remainder from the 2nd found capital.
You can replace the CHAR(65+SEQUENCE()) part with the array you used if you don't have Office 365
Related
I have been struggling with these two problems for the better part of the day. Please see this link to an example: https://docs.google.com/spreadsheets/d/1odU7oqc-WviLzQcghkbYbQG-4DC70-Q_hszb22Chljw/edit?usp=sharing
This is a simplified document I use to see which lecturer (name) has has added which of the 5 documents (on the right) to an online learning environment (one row for each course). The courses can be given in semester 1, 2, or in both. I want to use this document to automatically highlight a name if any of the five boxes on the right is empty if the semester I want to check (Cell D1) is similar to Column E. Furthermore, only the first time a name appears in red, should the e-mail appear so as well.
For this, I of course use conditional formatting (please see those formulas, also pasted in column M (range column C and D) and N (Range column D). N is the white conditional formatting overruling M, in which a N="TRUE" means it is whitened out).
Example 1 (Ans) shows how I intend the programme to work. The first instance shows shows both the name and e-mail in red, later instances do too unless the semester is not similar or all boxes on the right are ticked.
Example 2 (Bertrand) shows the first problem. If the first instance of a red name and e-mail occurs in a semester 'both', the second time the name should be red the e-mail does so as well. This keep occurring until a semester is similar to Cell D1, after which it is normal again.
Example 3 (Carel) shows the second problem. If the first instance in which a certain lecturer occurs all boxes on the right are ticked, the second time he occurs but does not tick all boxes his name shows in red but his e-mail doesn't.
I think problem 1 (example 2) is solved if I can get 'both' to somehow mean both 1 and 2, but I don't know how.
I think problem 2 (example 3) is solved if I can get COUNTIFS to ignore the rows is which all five boxes are ticked.
However, I have no clue how to do this. Is anyone able to help me with either (but ideally both) problems?
Thank you in advance!
I'm not entirely sure, but I think I've understood what you need.
For the first part (where a lecturer has less than all 5 subjects containing 'x' AND where E is either the value of cell D1 or the value of 'both'), try this:
Delete both of your existing conditional formatting rules.
Create a new conditional formatting rule for range = C4:C21 (or perhaps further down your sheet to row 977), with a custom formula of:
=AND(COUNTIF($G4:$K4,"x")<5,or($E4=$D$1,$E4="both"))
The style for the rule should have a red background.
For the second part (updated), this is a bit tricker with conditional formatting but I can offer a solution determined by the value of cells, like you had.
Delete the contents of cells M4:N21 (21 being where you have a formula in the furthest cell).
In cell M4, add the following formula:
=arrayformula(if(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),)<>"",countifs(iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),iferror(if(ifs(E4:E=$D$1,1,E4:E="both",1)+if(G4:G&H4:H&I4:I&J4:J&K4:K <>"xxxxx",1,)=2,D4:D,),),row($E4:$E),"<="&row($E4:$E))=1,))
It might seem a little complex, but it's done this way to use the functions that are compatible with ARRAYFORMULA so that it will keep working down the sheet as far as you have values in rows.
Now create a new conditional formatting rule for range = D4:D21 (or perhaps further down your sheet to row 977), with a custom formula of:
=$M4=true
The style for the rule should have a red background.
In addition to the question I posted previously, (Change text length based on drop down option selected), I have another scenario where a Bank's account numbers (BANK C) are either 10 or 15 digits long. The answer to my previous question facilitated changing the text length to a range (between 10 and 15 digits) and changing the text length to exactly 12 digits, by creating a lookup table and defining the min and max values.
I was told that a different approach would be needed to change the text length to either one of two values (meaning either 10 or 15 digits), but nothing I've tried so far has worked.
As shown in the last question:
I am using the following table:
I am using the following formula in my Data Validation:
=AND(LEN(B2)<=VLOOKUP(A2,F:H,3,FALSE),LEN(B2)>=VLOOKUP(A2,F:G,2,FALSE))
VLOOKUP will only return the first line and I need it find multiple so I can test against those.
How can I go about getting this to work, while still allowing the other two ways to work?
Maybe slightly different approach as shown below. Validation rule formula seems working to me:
=NOT(ISERROR(MATCH(LEN(C3),OFFSET($G$4:$G$9,,MATCH(B3,$G$3:$I$3,0)-1),0)))
We are just checking if we can find length in specific column in the table. Possible values means all possible lengths. You can also build your table horizontally, but this will require some formula adjustments. If you want, you can either expand Range G4:G9 and G3:I3 or change it to named range, or try referencing to column and header of table - these solutions will make our validation formula flexible (when you add item to list, formula will change automatically).
I am pretty sure that it is also possible to simplify that formula.
I'm sorry for cutting row numbers in the screenshot.
The following formula worked for me:
=IF(AND(ISNUMBER(SEARCH(1, A4)), AND(LEN(B4)>MIN(9), LEN(B4)<MAX(16))), TRUE, IF(AND(ISNUMBER(SEARCH(2, A4)), LEN(B4)=12), TRUE, IF(AND(ISNUMBER(SEARCH(3, A4)), OR(LEN(B4)=10, LEN(B4)=15)), TRUE,FALSE)))
So basically if "1" is found in cell A4, where the drop-down list of all the bank names is, it will only allow between 10 and 15 characters to be entered into cell B4 (where i'm inputting the bank account number). If "2" is found in cell A4, it will only allow 12 characters to be entered and if "3" is found in cell A4, only 10 OR 15 characters can be entered. Thanks for the replies though everyone.
I want to create a formula which pulls data from a file Model Results Tool - website.xlsm into another file in a tab called Step 2 - stacked ROI. I have built a formula to do this:
=IF(AND(B$3<>"",'Step 1 - description of models'!$B5<>""),SUMIF('[Model Results Tool - website.xlsm]Step 13 - ROI'!$B$3:$GT$3,B$3,'[Model Results Tool - website.xlsm]Step 13 - ROI'!$B$9:$GT$9),"")
where the B$3<>"" check is simply making sure that there is a column header for this metric and the 'Step 1 - description of models'!$B5<>"" check is making sure that the Model Results Tool - website.xlsm model has been listed on the front sheet reference list. NB. this is a list of models included within the project. Their names and the number of them will change project to project so this seems like the most sensible approach.
What I want to be able to do is to replace the string Model Results Tool - website.xlsm in the formula with the cell from the reference list which I have created 'Step 1 - description of models'!$B5<>"" such that the cell name is explicitly contained within the formula but it resolves to the content of the cell, i.e. Model Results Tool - website.xlsm.
I realise that this is a bit wordy and may seem over-kill but the reports are generated and analysed across a group of analysts and therefore needs to have governance set up in such a way that formulas aren't changed but look-up / reference lists can be.
Here are screenshots - please note that all data contained is completely made up
I propose to add an additional column in Sheet "Step 2 - stacked ROI" and fill it with the Model names. E.g. A7 thus contains digital.
Then the following formula will sum up your data from the desired sheet:
=IF(AND(C$3<>"",'Step 1 - description of models'!$B5<>""),SUMIF(INDIRECT("'"&VLOOKUP($A7,'Step 1 - description of models'!$A$5:$B$31,2,FALSE)&"Step 13 - ROI'!$B$3:$GT$3"),C$3,INDIRECT("'"&VLOOKUP($A7,'Step 1 - description of models'!$A$5:$B$31,2,FALSE)&"Step 13 - ROI'!$B$9:$GT$9")))
The restriction that teylyn mentioned is of course true (only working for open workbooks), but the numbers will update and stay in the result sheet after you opened and closed all the source worksheets.
Hope my hint of the formula helps you.
As I understand it, you want to store the name of a file in a cell, then use a reference to that cell in a formula that performs calculations on data from that file.
Excel's INDIRECT() function can be used to convert text to a cell reference. Unfortunately, INDIRECT() will not work if the text in the cell points to a closed workbook. Any file referenced by INDIRECT() must be open for the formula to work. In many cases this defeats the purpose of a dynamic file name.
There is a free add-in by Laurent Longre called Morefunc.xll, which has a function called INDIRECT.EXT(), which works with closed workbooks. Morefunc.xll can be downloaded here. Note that it does not work with 64 bit versions of Excel.
I looked at a couple suggestions here and didn't find something that specifically worked for me. I would prefer not to use an Array Formula if possible. However, if that's the only way, I'll try to work with it.
I am working on an attendance workbook of sorts in Excel 2013. The workbook contains a Calculations sheet, a Lists sheet and a sheet for each month of the year. The Lists sheet has a list for names and a list for the months. I have included a link to a sample workbook to demonstrate how the sheets are setup and the basic functions, names, lists, etc that I am using.
My sample workbook:
https://app.box.com/s/mgvums1vmnmnec7e7d0p4vi5daoyo5nv
When looking for the last non-empty cell in a specific row/range, I receive the correct result when I use the following LOOKUP on each specific Month sheet: (Which I found after some digging on a few sites) =LOOKUP(2,1/(C5:AG5<>""),C$4:AG$4)
- For the Month of Feb, the last entry in the range C5:AG5 is in AA5, which is the 25th.
I also receive the correct result when I use the following Lookup from any non-Month sheet: =LOOKUP(2,1/(Feb!C5:AG5<>""),Feb!C$4:AG$4)
That being said, the two specific issues I am running into, are as follows:
I have been unable to work out how to come up with the last non-empty cell (which is the last marked day of attendance) when using Name and Month information selected in the Combo Box/Form Controls. Simply said, in my sample workbook, I want to know the last day in Feb that Johnny was in attendance.
I've tried starting simple, just using the "Month" I selected. I tried a few different itterations of the following:
=LOOKUP(2,1/(Month&"!C5:AG5<>"""),Month&"!C$4:AG$4")
The closest I've gotten was the above Lookup, which ends up turning into what you see below (when viewed in Calculation steps). It of course returns a #VALUE! error.
=LOOKUP(2,1/"Feb!C5:AG5<>""",Month&"!C$4:AG$4")
I also tried this Array Formula and it gave me a result of 4. Which, isn't the proper result. And, I don't know where the result actually came from.
=MAX((INDIRECT(F4&"!"&"C5:AG5")<>"")*(ROW(INDIRECT(F4&"!"&"C$4:AG$4"))))
I have been unable to work out how to come up with the last non-empty cell across all the Month sheets when using the selected Name from the Combo Box/Form Control. Basically, I want to know the last day of the year that Johnny was in attendance. In this sample workbook, that would fall on April 11th. I understand that the formula would just return "11". I believe I can format the result after the fact, using the resulting sheet name. (In this sample case, Apr)
I am fairly certain I will need to use a VLOOKUP. I just can't seem to break the barrier between the general concepts of what I want and the proper way of formulating it.
Any help would be appreciated. I'm feeling pretty lost at the moment. If you need more info from me, please let me know.
Thanks,
Kurewe
The key is to use INDIRECT with the exact same LOOKUP formula you already had and use the MATCH formula to determine the row number for the selected name.
Place the following formulas:
G3: =MATCH(F3,NameList,0)+4 (find the item number of the selected name within NameList)
H2: =F4&"!C4:AG4" (construct the address for the date row for the selected month)
H3: =F4&"!C"&G3&":AG"&G3 (construct the address to use for the selected name and month)
E9: =INDEX(MonthList,ROW()-ROW(E$8)) copy down to E20 (find the name of the month for this row using MonthList)
G9: =E9&"!C4:AG4" copy down to G20 (construct the address for the date row for the month in E9)
H9: =E9&"!C"&G$3&":AG"&G$3 copy down to H20 (construct the address to use for the selected name and the month in E9)
F9: =IFERROR(LOOKUP(2,1/(INDIRECT(H9)<>""),INDIRECT(G9)),"(n/a)") copy down to F20 (find the last day with an "X" in it using the addresses in G9 & H9)
G4: =LOOKUP(2,1/ISNUMBER(F9:F20),ROW(F9:F20)-ROW(F8)) (find the index of the first cell with "(n/a)" in it)
F5: =LOOKUP(2,1/(INDIRECT(H3)<>""),INDIRECT(H2)) (find the last day with an "X" in it for the addresses in H2 & H3)
F6: =INDEX(MonthList,G4)&"-"&INDEX(F9:F20,G4) (construct the date of the last day of attendance within the year)
So here is a problem that I have never come across before. I Import an ISIN (for example DE0002635307) from a cell, which is defined as a text. I need to use this to reference to a cell by that name. So:
sub ISINWriter
dim ISIN as String
ISIN = ThisWorkbook.Sheets(i).Cells(j, 4).Value()
ThisWorkbook.Sheets(i+1).Cells(f, 4).Formula = "=" & ISIN
End Sub
For most of the ISINs this works fine, except if there are 4 or more zeros in a row. If that happens - for example FR0000120073 - it writes "=FR120073" into the cell. It just eats the zeros INSIDE the string! Any ideas?
I use Excel 2010 and Windows 7.
Thanks a lot.
If you use the Name Manager to try to create a named range (or more accurately a named formula) called "FR0000120073" then you should find that you get an error. Something like (from Excel 2007 on my machine):
The name that you entered is not valid.
Reasons for this can include:
- The name does not begin with a letter or an underscore
- The name contains a space or other invalid characters
- The name conflicts with an Excel built-in name or the name of another object in the workbook
The clue is in the last part of the third reason. FR120073 is a valid cell address in these days of 16Kx1m cell worksheets.
The first reason above may be useful, though: _FR0000120073 is a valid name. Could you use that?
EDIT: Removing my last answer so this makes sense.
Basically your cell references are an AlphaNumeric value. Take A1 for example A is the column 1 is the row. This issue is occuring because 0001 is the same as 1. so a reference to cell A001 is going to be the same as cell A1.
It looks like Excel has some built in functionality to remove leading 0's from your references to cells.