User Profile
SnowMan55
Bronze Contributor
Joined 3 years ago
User Widgets
Recent Discussions
Re: HOW TO: "If cell contains specific text display the immediate next word after it"
Regarding the thread (discussion), I would say "If in doubt, start a new thread (discussion). You can always include a link in your post that refers to the closely-related thread(s), if that is appropriate." You don't say which Excel product you are using (Excel 365, Excel 2019, etc.). If you are using Excel 365 or Excel for the web, the new TEXTBEFORE function handles this nicely: =TEXTBEFORE(" - ", A1) (Most spaces in my formulas are optional; I include them for improved readability. But in this case the spaces around the hyphen are appropriate.) Change the A1 reference if appropriate, and copy the formula down as needed. If you are using an older Excel product, this see the attached workbook.13Views0likes0CommentsRe: Switch Panes Using F6 not working
According to the Microsoft document Keyboard shortcuts in Excel (the Windows tab): F6 F6 alone: switches between the worksheet, ribbon, task pane, and Zoom controls. In a worksheet that has been split, F6 includes the split panes when switching between panes and the ribbon area. Shift+F6: switches between the worksheet, Zoom controls, task pane, and ribbon. Ctrl+F6: switches between two Excel windows. Ctrl+Shift+F6: switches between all Excel windows. Maybe the list of destinations has included the ribbon, etc., for some time (and you did not realize this because the sequence started with "other pane"), but the sequence of destinations has perhaps recently changed. (?)45Views0likes0CommentsRe: Populating a Matrix from a Table
Re: Re 1 — Yes, and the volume of information gets "better", as you will see in my responses to your notes. Re: Re 2 — You will see the problems in the second attached workbook. result2 is the (intententional) cause of the duplication, not involved in prevention of such. The LENgth functions are just another way of checking for empty strings. If your Flight + Match combinations are unique, you won't get "contradictory results" by changing boat/team/skipper names. (But rematches late in the regatta would be a problem, which we've not discussed.) Re: Smokey and the Bandit — No, I never knew that, as I did not watch those movies.132Views0likes0Comments- 52Views0likes0Comments
Re: COUNTIFS for multiple ranges
A simple technique is = COUNTIFS($A$2:$A$1000, "Douglas", $B$2:$B$1000, "<499", $C$2:$C$1000, "*") + COUNTIFS($A$2:$A$1000, "Douglas", $B$2:$B$1000, "<499", $D$2:$D$1000, "*") + COUNTIFS($A$2:$A$1000, "Douglas", $B$2:$B$1000, "<499", $E$2:$E$1000, "*") + COUNTIFS($A$2:$A$1000, "Douglas", $B$2:$B$1000, "<499", $F$2:$F$1000, "*") (Yes, it works without the extra spaces and even if you don't break it into multiple lines.) See the attached workbook for more information.36Views0likes0CommentsRe: Populating a Matrix from a Table
Very well, though you can end up with inconsistent match results (and you did, as Patrick and Hans and I all noticed). So in this newer attached workbook, I have formulas that can handle either one row or two rows of competition data per match, and it includes formulas to identify inconsistent match results. (When you find a solution that meets your needs & desires, please mark it as "the" solution.)98Views0likes4CommentsRe: Populating a Matrix from a Table
I contend that you do not need to enter two lines of data per match, and because of the extra typing and potential errors, you should not do so. The attached workbook demonstrates this with one line of data per match. Because it uses the VSTACK function, Excel 365 or Excel for the web is required.131Views0likes7CommentsRe: Monthy budget planner starting on 15th...?
This solution would I suppose be considered an intermediate level of complexity. The IFS function is not commonly used, and the LET function is fairly new. The important part is understanding the main cell formulas. To make it easier for you, I have added descriptive text in that regard into column C on the _Info worksheet. I added a bonus column on the Example worksheet, and have added links to information about conditional formatting and custom number formats at the bottom of the _Info sheet.35Views0likes0CommentsRe: Excel - Add value based on colour
There are at least two possible sources of error: Data type - The code supplied by Logaraj Sekar sums into a Long variable. Long variables can only contain integer values. As your Total numbers include decimal values, maybe you have changed the data type; but I could speculate that your formulas there are calculating using the custom function SumByColor and are adding in some other values not dependent on color. Timing - A problem in calculating based on fill color (or text color or possibly other properties) that is set by a conditional formatting (CF) rule is that cell formulas (including the custom functions they use) are calculated first; then CF rule formatting is applied. So a change to a value in a cell will occur before the fill color might be changed. The latter is one reason I recommend against doing color-based selection (filtering). Instead, create some categorization values in helper cells (which can be hidden from view), and FILTER (or GROUPBY) based on those values.438Views0likes0CommentsRe: Monthy budget planner starting on 15th...?
The conditional formatting (CF) rule should instead be the one where you always specify a formula (at least in Excel; I would guess Google Sheets supports that also). See the attached workbook for my solution, explanations, an assumption, and reference material.7Views0likes1CommentRe: Rename Cell to Various Different Sheet Titles
"Having to do it manually at the scale required would be quite difficult." That seems unlikely. The "scale" is one new worksheet at a time. But perhaps you meant that manually creating the initial list of existing worksheets would be tedious. Yes, it could be (for example, if you inherited a workbook with hundreds of worksheets). This post suggests how that could be done readily. A better-behaved macro would not modify an entire column on the active worksheet (however important that may be!) without user confirmation, leaving no way to undo the data change. So consider this code instead: Sub LoadListOfWorksheets() ' This macro creates a list of the worksheets in the active workbook ' into column A (see the constant below) of the active worksheet, ' subject to confirmation by the user. Const strCOLUMN_ID = "A" 'for output Const in4FIRST_ROW_TO_USE As Long = 2 'for output Dim objWkbook As Workbook Dim objListWksht As Worksheet Dim strFullColumn As String 'identifies the range Dim in4CellsWithContent As Long '…within the range ' -- Related to the user confirmation: Dim dstrMessage As String Dim in4Icon As Long Dim in4UserResponse As VbMsgBoxResult ' -- Indexes, etc.: Dim in4Wksht As Long '…within the Sheets collection Dim in4OutputRow As Long '---- Capture information and do preparations. Set objWkbook = ActiveWorkbook Set objListWksht = ActiveSheet ' strFullColumn = strCOLUMN_ID & ":" & strCOLUMN_ID '---- Get user confirmation. in4CellsWithContent = WorksheetFunction.CountA( _ objListWksht.Range(strFullColumn)) dstrMessage = "Is it OK to put the worksheet names into column " _ & strCOLUMN_ID _ & vbCrLf & " of worksheet " & objListWksht.Name _ & vbCrLf & " in workbook " & objWkbook.Name & "?" If in4CellsWithContent > 0 Then dstrMessage = dstrMessage & vbCrLf & vbCrLf _ & "WARNING: Column " & strCOLUMN_ID & " has " _ & Format$(in4CellsWithContent, "#,###,###,##0") _ & " cell" & IIf(in4CellsWithContent = 1, "", "s") _ & " that contain" & IIf(in4CellsWithContent = 1, "s", "") _ & " some content. That content will be erased !!" in4Icon = vbExclamation Else in4Icon = vbQuestion End If in4UserResponse = MsgBox(dstrMessage, in4Icon Or vbYesNo _ Or vbDefaultButton2, "Load List of Worksheets") If in4UserResponse = vbNo Then Exit Sub '---- To improve performance of the remaining code, turn off ' screen updating. Application.ScreenUpdating = False '---- Clear any existing content. With objListWksht.Range(strFullColumn) .ClearContents .NumberFormat = "@" 'to prevent Excel from converting certain _ worksheet names to a date or number or Boolean End With '---- Create an unsorted list of all worksheet names. in4OutputRow = in4FIRST_ROW_TO_USE For in4Wksht = 1 To objWkbook.Sheets.Count objListWksht.Range(strCOLUMN_ID & in4OutputRow).Value = _ objWkbook.Sheets(in4Wksht).Name ' in4OutputRow = in4OutputRow + 1 Next in4Wksht '---- Restore setting(s). Application.ScreenUpdating = True End Sub I will leave it as an exercise for you to write worksheet names into one row, rather than into one column. Note that this macro would not even have to be stored in the relevant workbook. You could place it into your Personal.xlsb workbook. As for automatically updating a list of workbooks (whether in a range of cells or an Excel table), that's complicated. See the attached workbook for more information and example VBA code. Edit: fixing another example of the forum dropping the file that I attached Edit: trying a third time Edit: and a fourth time1View0likes0CommentsRe: NUMBER TO WORDS
Hans's formulas do not take advantage of the LET function. I wrote three alternative formulas that use the LET function to reduce the size of the formulas, improve calculation speed, and make the formulas easier to read. See the attached workbook. In my performance tests, each of the three alternatives had about the same performance. I like the shortest formula the best: =IFS(A3<0,"Referred cell value must not be negative!", A3>10^12-0.01,"Exceeds maximum which is 999999999999.99", TRUE, LET(cell, A3, use_proper_case, TRUE, text_int, TEXT(INT(cell),REPT(0,12)), dec_pt_posn, FIND(".",cell), hundreds, {"","one hundred ","two hundred ","three hundred ","four hundred ","five hundred ","six hundred ","seven hundred ","eight hundred ","nine hundred "}, teens, {"ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"}, units, {"","one","two","three","four","five","six","seven","eight","nine"}, hyph_units, {"","-one","-two","-three","-four","-five","-six","-seven","-eight","-nine"}, words, TRIM(CONCATENATE( INDEX(hundreds, MID(text_int,1,1)+1),CHOOSE(MID(text_int,2,1)+1,"",INDEX(teens, MID(text_int,3,1)+1),"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"), IF(VALUE(MID(text_int,2,1))>1,INDEX(hyph_units, MID(text_int,3,1)+1),IF(VALUE(MID(text_int,2,1))=0,INDEX(units, MID(text_int,3,1)+1),"")),IF(cell>=10^9," billion ",""), INDEX(hundreds, MID(text_int,4,1)+1),CHOOSE(MID(text_int,5,1)+1,"",INDEX(teens, MID(text_int,6,1)+1),"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"), IF(VALUE(MID(text_int,5,1))>1,INDEX(hyph_units, MID(text_int,6,1)+1),IF(VALUE(MID(text_int,5,1))=0,INDEX(units, MID(text_int,6,1)+1),"")),IF(VALUE(MID(text_int,4,3))>0," million ",""), INDEX(hundreds, MID(text_int,7,1)+1),CHOOSE(MID(text_int,8,1)+1,"",INDEX(teens, MID(text_int,9,1)+1),"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"), IF(VALUE(MID(text_int,8,1))>1,INDEX(hyph_units, MID(text_int,9,1)+1),IF(VALUE(MID(text_int,8,1))=0,INDEX(units, MID(text_int,9,1)+1),"")),IF(VALUE(MID(text_int,7,3))," thousand ",""), INDEX(hundreds, MID(text_int,10,1)+1),CHOOSE(MID(text_int,11,1)+1,"",INDEX(teens, MID(text_int,12,1)+1),"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"), IF(VALUE(MID(text_int,11,1))>1,INDEX(hyph_units, MID(text_int,12,1)+1),IF(VALUE(MID(text_int,11,1))=0,INDEX(units, MID(text_int,12,1)+1),"")) )), IF(use_proper_case, PROPER(words), words) & IF(ISERROR(dec_pt_posn), IF(INT(cell)=0,""," and ")&"00/100", IF(INT(cell)=0,""," and ")&--LEFT(MID(cell,dec_pt_posn+1,2)&"00",2)&"/100") ) ) Note that I included an "option" (use_proper_case) for generating either proper-case text or lower-case text.20Views0likes0CommentsRe: Excel search box not returning hyperlink
There is what I consider a simple workaround. It involves separating the URLs from the friendly names, and using formulas to reconstruct the hyperlinks where needed/desired (including the Range column in Table1). See the attached workbook.63Views0likes0CommentsRe: Order of multiple functions in a formula.
<< I am not getting UNIQUE values in the ROUTE column >> Correct. The UNIQUE function, when applied to a 2-dimensional range, returns a row for each "unique" (distinct, actually, by default) combination of values. The Microsoft documentation does a poor job of displaying this; even this Ablebits.com tutorial is weak on it. So if you do not want multiple rows, exclude the columns (via omission in the CHOOSECOLS function, most likely) that would result in multiple rows before you apply the UNIQUE function. In the sample data you show, the Departure Time is the same for Route 1DO2 in both entries,there is only one truck identifier, and it is used for both Shipping and Receiving, and at multiple Doors. OTOH, if what you want is seven lists of independent distinct values, one from each of the columns that stand next to each other, then your multi-column sort order criteria has no meaning. You could use seven formulas, but... See the changes in the attached workbook.56Views0likes1Comment
Recent Blog Articles
No content to show