I have a table in my workbook that pulls information from another sheet. In column A there are names; A1=Tom, A2=Sarah, A3=Steve, etc.. Column B has dates; B1=July26, B2=August08, B3=July26, etc.
There are 10 rows in my table. What I'm trying to do is compress the information down into a single cell C1, and have it as a single line of text. So for this example: "Tom,Steve: July26, Sarah: August08"
Right now I've been building an IF statement to compare, but I was wondering if there was a better way; one that doesn't risk a typo mid way that misses something.
This is what I have (I've started from the bottom (row 10) and building up: =IF(B9<>B10,A9&": "&B9&" "&A10&": "&B10,A9&","&A10&": "&B9)
Any help would be appreciated, thanks
I think that your process of building from the bottom up is the correct way. Otherwise a single formula would be too complicated, and VBA might be necessary.
To build from the bottom up, this is the formula you need at C10. Enter it then copy/paste into C1:C10.
C10:
=A10 & IF(B10=B11, ",", ": " &TEXT(B10, "mmmmdd") & ". ") & C11
p.s. it supposes that your column B contains dates formatted this way. If they are actually text, then replace TEXT(B10, "mmmmdd") with simply B10:
=A10 & IF(B10=B11,",", ": " & B10 & ". ") & C11
Related
I am looking for help with a formula in Excel to find a specific number in a string of numbers.
Our accounting system pulls a report showing numbers from 1 to 10 and each line can have numerous numbers listed in the cell, each separated with a ";".
What I want to do is create a formula that allows me to simply look for the number in columns O to X (row 3) and fill that number in the corresponding cell.
So starting from row 4, I would like to create a formula that finds each number in the string and simply fills in the one I am looking for in each cell, for example I would like the end result to look like the below example:
If the number doesn't appear then that column is left blank, but if it is found it simply adds itself into the corresponding column.
Hopefully someone out there can help me with this.
Regards;
Greg
formula in B3
in German:
=WENN(ISTFEHLER(FINDEN(";" & B$2 & ";"; ";" & $A3 & ";"));"";B$2)
in English:
=IF(ISERROR(FIND(";" & B$2 & ";" , ";" & $A3 & ";")),"",B$2)
Try this in cell O4:
=IF(NOT(ISERROR(SEARCH(O$3,$N4,1))),O$3,"")
Notes:
Assumes your numbers 1 to 10 are in row 3 (i.e O3:X3)
The following formula works great for the most part. I found the solution to my first issue, which was how to return a value based on partial contents of another cell. Check out Scott Craner's solution. Works great! However, when I started entering numbers I get the #NUM! error.
=INDEX(C:C,AGGREGATE(15,6,ROW($C$1:INDEX(C:C,MATCH("zzz",C:C)))/(ISNUMBER(SEARCH(" " & $C$1:INDEX(C:C,MATCH("zzz",C:C)) & " "," " & A1 & " "))),1))
I'm thinking that I'm getting the error because there are "." in the string.
Any help would be appreciated.
The formula you have doesn't work in that case because of what Scott pointed out in his answer:
"The SEARCH will search for matches. The " " & and & " " make sure we are looking for the entire word, So we do not get false positives on things like eric and erica.."
You could remove those spaces from his formula, i.e.
=INDEX(C:C,AGGREGATE(15,6,ROW($C$1:INDEX(C:C,MATCH("zzz",C:C)))/(ISNUMBER(SEARCH($C$1:INDEX(C:C,MATCH("zzz",C:C)),A1))),1))
to make B5 return what you want - which is not a whole "word" but a part of A5, but as a caveat that might allow for false positives. Row 5 is not the same scenario as 1-4. So take this answer with a grain of salt, depending on your data.
The only way my client can provide me these addresses is with the location is in one row: Location Name, street address, city.....and then the row below it contains the zip code. This repeats for 1600 lines.
I, of course, need all the info on one line. Is there a genius out there than knows how to make short work of putting the zip code on the line above it?
If you have address in columns A, B and C in the first row and zip code in column A in second row, try the below formula,
=INDEX(A:A,ROW()*2-1,1)&" " &INDEX(B:B,ROW()*2-1,1)& " " & INDEX(C:C,ROW()*2-1,1)& " " &INDEX(A:A,ROW()*2,1)
If you are starting from some other row other than row 1, you may have to modify the formula a little bit. Hope this helps.
Use a formula to combine your columns.
Here we have some test data.
In column D, specify a formula such as =A1 & ", " & B1 & " " & C1
If you're no familiar with formulas, just use "=" to denote the start of one, and then use "&" to concatenate your values.
As for as implementing this on a multi-row basis, you can easily do so. Once you drag your formula down, it'll auto increment the column names unless you specifically specified it not to. I won't get into that right now though.
So what I would do is just add an IF statement in your formula to account for those rows which are not intended to be used. Using a formula such as this: =IF(B1="", "", A1 & ", " & B1 & " " & A2), I can get the following results.
I have a list of unique ids and values on one sheet in excel as in the image below:
Is there a way to return only the values in the order they appear (left to right) on a separate sheet/location? For example, I would want to return for ID '1002' the values 35,32,44.. not the blanks. I am then going to turn those values into a Sparkline.
I am using excel 2010, if that makes a difference.
Thanks!
Sam
Try this formula:
=SUBSTITUTE(TRIM(B2 & " " & C2 & " " & D2 & " " & E2 & " " & F2)," ",",")
EDIT:
_______________________________________________________________________________
Hope this is not too late to answer your question.
Lets assume your data is in Sheet1 as in the image below:
Now, in Cell B2 of Sheet2 enter the following formula:
=IFERROR(INDEX(Sheet1!$B2:Sheet1!$F2, SMALL(IF(ISBLANK(Sheet1!$B2:Sheet1!$F2), "", COLUMN(Sheet1!$B2:Sheet1!$F2)-MIN(COLUMN(Sheet1!$B2:Sheet1!$F2))+1), COLUMN(A1))),"")
This is an array formula so commit it by pressing Ctrl+Shift+Enter
Drag this formula across till Column F and down till Row 4 or as required. This will give you following result.
I guess this is what you are looking for.
Based on "Concatenating Names with Delimiters" by Allen Wyatt you can use the formula below to achieve the result you wanted.
=MID(IF(B2<>"",","&B2,"")&IF(C2<>"",","& C2,"")&IF(D2<>"",","&D2,"")&IF(E2<>"",","&E2,"")&IF(F2<>"",","&F2,""),2,2000)
Regards,
I want to make a column that lists a +or- 5%variance of a certain calculation.
For example, in column A and B there are a list of numbers and I want column C to show ColumA/ColumnB + or - 5%.
So if A1 = 10 and B1 = 12 then I want C1 to show ".792 to .875" or something like ".792 - .875" or "(.792,.875)".
In order to make it easy to look at, maybe I want a certain format that would change the colors of the 95% # and the 105% number ...
What would one do in these kind of situation?
You can use CONCATENATE, something like this:
=CONCATENATE(ROUND(A1/B1-(A1/B1*0.05),3)," - ",ROUND(A1/B1+(A1/B1*0.05),3))
As far as I know there is no way to have multiple formats in one cell containing a formula. It might be posible with VBA.
To get what your looking for you could use the text function.
You will have to generate the text with a formula, something like
="(" & text(c1,".000") & " - " & text(d1,".000") & ")"
Where c1 and d1 are the ranges you wish to show.
To get it to format with colour you can use conditional formatting on c1 and d1 to colour the cell where your formula is.
SincereApathy's answer doesn't work for me. Based on his answer, but using in-line concatenation instead of the CONCATENATE function:
=ROUND((A1/B1-0,05);3) & " - " & ROUND((A1/B1+0,05);3)