I use concatenate to pull data together from different cells in my spreadsheet. Since my data changes daily, I want the formula to also change daily without having to manually input the new cell in the concatenate formula.
UPDATE: Is there a way to use VBA coding to automate the concatenate process based on the following criteria? I have a row of data from D4:AH4 that I insert daily based on the new day. When I use the concatenate and the following formula:
=CONCATENATE(TEXT('Raw Data'!B4,"m/d")," ",TEXT('Raw Data'!C4,"")," ",TEXT('Raw Data'!E4,"0.0%"))
E4 being the cell that changes daily where next day would be F4, G4, etc... B4 = Today() C4 = Text of my choice E4 = is current days data but changes to the next cell daily. Example E4, F4, G4, etc.
=TEXT(B4,"m/d")&" "&C4&" "&TEXT(OFFSET(D4,0,COUNTA(D4:AH4)-1,1,1),"0.0%")
I use the & operator instead of CONCATENATE, but they do the same thing. The last element uses OFFSET. It starts at D4 and moves 0 rows down and x columns to the right, where x is the COUNTA of what's in D4:AH4.
It seems you need to create a dynamic range using a combination of OFFSET and COUNT.
See here, or Google for "excel dynamic range".
Related
I am looking for a way to accomplish the following using spreadsheet formulae: the output in cell D5 should be the array from cell B5 to the last populated cell (assume the range is contiguous). Thus if text were typed into cell B10, the output would automatically expand.
However, I want to avoid the volatile OFFSET and INDIRECT functions.
So I have this formula in cell D5:
=UPPER(B5:INDEX(B:B,ROW(B5)+COUNTA(B5:INDEX(B:B,ROWS(B:B),,1))-1))
but this is unsatisfactory as it references the B:B column.
In effect I want a construction that returns me B:B given the cell B5 ie the equivalent of =INDIRECT("C" & COLUMN(B5),"FALSE"), but in a non-volatile format.
Any suggestions?
NB. I don't have the very latest Excel. I have LET, SEQUENCE, FILTER etc, but not LAMBDA and the functions that came with it (ie I can't do recursive LAMBDA calls).
Make column B data into a table
the content of cell D5 can then be dragged to a different location, without the formula results changing.
In Excel 2016, I have a "Brands" column, each of its rows containing a string. The set of possible string values is limited, and they may appear more than once.
There is related data in another column, "Models". Each model value is always different.
How can I get Excel to generate a column for each existing brand and populate it with the corresponding Models in an automatic way?
My problem is that I can't do it manually because for each analysis, the amount of Brands is different and I don't know it beforehand.
This would be the input:
And this is the expected output:
Any ideas?
Thank you in advance!
Try using an array formula. First, put the distinct brand values on row 1, starting in column D. You can use column C if you want, but I like to have an empty column between the data and the desired results.
D1 = Apple, E1 = Nokia, F1 = Samsung, G1 = Xiaomi
Then, just below Apple in cell D2, paste this formula:
=IFERROR(INDEX($B$2:$B$9999, SMALL(IF(D$1=$A$2:$A$9999, ROW($A$2:$A$9999)-ROW($A$2)+1), ROW(1:1))),"")
If you have more than 9999 rows, then adjust as needed in the formula.
With the cursor still in the formula, make it an array by simultaneously pressing CTRL-SHIFT-ENTER.
Copy the formula across to cells E2, F2 and G2. You may need to repeat the array trick (CTRL-SHIFT-ENTER) for each of those again if things look wrong. So, your excel will look like this:
Now, drag the formulas down as far as you need. The iferror part of the formula will ensure that cells look clean if no more models are found.
---EDIT AFTER RECENT COMMENT---
I cannot determine how to automatically pick distinct values from column A and automatically convert them to a row. It's easy to keep it in a column, but the transpose to row is troubling.
At any rate, here's the ugly update. Cell D1 would simply state "Brands". In cell D2, make this an array formula (CTRL-SHIFT-ENTER).
=IFERROR(INDEX($A$2:$A$9, MATCH(0, COUNTIF($D$1:D1, $A$2:$A$9), 0)), "")
So, row 2 will be your brands. Drag the formula across, repeat the array trick.
Now, in cell E1, type formula =D2. Drag across.
Place the formula suggestion from the original answer, starting in row 3. End result looks like this below. It should be "automated" now, but it's not appealing. Minor edits will help (making row 1 nearly invisible, for example).
I'm trying to create a formula in column K which sums all cells that apply , in column J, only when the following conditions are true:
dates are the same in column A
AND client name is the same in column B
For example, in cell K2, I want the sum of J2+J3+J4 because A2=A3=A4 and B2=B3=B4.
K5=J5 only, because there are no other dates with the same client name.
K6=J6+J7 because A6=A7 and B6=B7.
What kind of formula would I use for this? I can't figure out how to do it with a SUMIFS.
I would try using a pivot table with:
The names as row values
The dates as the column values
And funds received using SUM in the values column
Edit
Based on #pnuts comments here is how to get the values in column K. Put this in K2 and drag down.
=IF(OR(COUNTIFS($B$1:B3, B3) = 1, B3 = ""), SUMIFS($J$2:J2, $A$2:A2, A2, $B$2:B2, B2), "")
This formula will give blank values until the formula finds a new client on a new date. However, I still think using pivot table is a better solution.
However, I still find the pivot table
In cell K2 put following formula:
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,B2)=1,SUMIFS($J$2:$J$10,$A$2:$A$10,A2,$B$2:$B$10,B2),"")
Adjust row 10 value. It will be last row of your actual data.
Copy down as much you need.
EDIT
Uploaded file shows the cause behind formula not working correctly for you. It turned out to be whitespace characters in column B (names) data e.g.
Cell B3: "Moe John" has a trailing space.
Cell B10: Same case with "Doe Jane"
If you want to use above posted formula then all names shall be corrected. Or alternatively to deal with spaces you can adopt below approach.
=IF(COUNTIFS($A$2:A2,A2,$B$2:B2,"*"&TRIM(B2)&"*")=1,SUMIFS($J$2:$J$28,$A$2:$A$28,A2,$B$2:$B$28,B2),"")
Notice the change in COUNTIFS formula where B2 is now replaced with "*"&TRIM(B2)&"*".
Even such formula will take a beating if you have uneven whitespace characters in between your data. I'd suggest normalizing it as much as possible.
So at the top of my Excel sheet I have 2 cells, A2 and B2, where people can enter a starting and ending date.
On a seperate sheet I have an enormous list of starting and ending dates in columns A and B, and corresponding data for each of these 'events' in columns D through G. I need my function to copy all rows where the starting date falls between the two specified dates, and copy the data to the first sheet, in cells A4 - G4 through A100 - G100. (I just chose 100 as a large number, to make sure the area where the data gets placed is large enough)
I'm guessing this function I need includes the INDEX function, but I only know how to use it to look up one data cell at a time, not how to copy an entire range of cells.
Can anyone help?
No helper columns required.
Enter this formula into cell A4:
=IFERROR(INDEX(data!D$2:D$9999,SMALL(IF((data!$A$2:$A$9999>=$A$2)*(data!$A$2:$A$9999<=$B$2),ROW(data!$D$2:$D$9999),9E+99),ROW(1:1))-1),"")
This is an array formula and must be confirmed with Ctrl+Shift+Enter.
Now copy the formula to the range B4:D4.
Now copy the A4:D4 to the range A5:D100.
That's it.
Let's say Column C in the data sheet is blank, and free to add a formula.
Let's also assume that the data begins in row 2.
Then the following formula can be put in C2 & copied down:
=IF(AND(A2>=Sheet1!$A$2,B2<=Sheet1!$B$2),C1+1,C1)
Basically it is saying that if the beginning date of the current record is greater than or equal to the date the user is looking for, and the ending date is likewise within range, iterate the record, otherwise not.
At this point the user sheet can have a simple VlookUp as follows:
In D1: =VLOOKUP(ROW($A1),Sheet2!$C:$G,COLUMN(B$1),0)
Copy this across to G and down however many rows you like.
Please take a look at the attached snapshot.
How to convert the Original Table to the Required Table, in the easiest manner ?
Here, I have shared just a small sample, the real table is quite big having more then 100 rows / symbols and 100 columns / dates.
Therefor it is not possible to manually copy paste the data to change the table format.
The final output table will have just 3 columns "symbol, date and value" arranged according to the dates in ascending order.
Please suggest how to do this. Thanks
here it is.
Put Original table in one sheet, say Sheet1. Top left cell being A1 = Symbol
Go to another sheet, say Sheet2.
In cell A1 put: Symbol
In cell B1 put: Date
in cell C1 put: Value
Go to cell A2 and put this formula:
=INDIRECT("Sheet1!A" & 2+MOD(ROW()-2; X);TRUE)
Go to cell B2 and put this formula:
=INDIRECT("Sheet1!R1C" & 2+ROUNDDOWN((ROW()-2)/X;0);FALSE)
Go to cell C2 and put this formula:
=INDIRECT("Sheet1!R" &2+MOD(ROW()-2; X)&"C" & 2+ROUNDDOWN((ROW()-2)/X;0);FALSE)
In all formulas above, replace X with the number of Symbols you got. In your original table there are 4.
Now fill down as needed
Note: If functions don't work, use comma(,) instead of semicolon(;).