Repetitive autoincrement between spaces - excel

I would like to know how to write a number under a cell with text, then write that same number until it finds another text, then increment it and do the same over and over. Keep in mind that we dont know how many spaces will it be between each text.
Here is a image of what I mean, its very clear here:
I am no expert on excel just used it a few times and know the basics but I really need this formula to avoid hours and hours of work doing this manually. You would help me a lot.

Without vba, you need a separate column and this formula:
=IF(E1="",COUNTA(E1:$E$1),E1)
The trick is in the range, which is always starting with E1, because of the two $-signs, but ending with the pulled row. Then simply pull down column F, it will increment:

Related

Extract text between two characters multiple times on multiple lines in Excel

I want to find an easy way to extract text between characters multiple times within the same cell. So in the example below, I want to take the information between the parenthesis and get them into the adjacent column, as shown. Is there a fast way to do this?
My process has been to use Text to Columns to separate them out into different cells, then use a mid function to get what's between the parenthesis, and string them all back together. I'm wondering if someone can think of a better way to do this. Thank you!
I should note-- I want to do this entirely within excel.
For example:
Formula in B1:
=TEXTJOIN(CHAR(10),1,LEFT(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(A1," (",CHAR(10)),CHAR(10),"</s><s>")&"</s></t>","//s[substring(.,1,3)*0=0]"),3))
Enter as array!
If you are interested in FILTERXML, you might want to have a look at this.
Assuming the 1st data is in A1, put :
=REPLACE(A1,1,FIND("(",A1),"") in C1
then,
=IFERROR(REPLACE(C1,FIND(")",C1),FIND("(",C1)-FIND(")",C1)+1," "),C1) in D1
and drag D1 to Q1. lastly, put
=Q1 in B1.
That shall do it.
Idea : replace all text between the ) & ( with a space, 15 times.
hope it helps.

Filter Cells as argument to a function in a formula

I am a programmer, so please bear with me. I understand that Excel isn't necessarily what I am used to in other domains, but I'm cracking my head open on how to accomplish something that seems somewhat simple.
I have a column of numbers that are themselves the basis of a formula. I want to filter those cells based on some criteria and pass them to another function to perform a calculation.
I understand that this can be done with "filters" in the excel sense. This would mean I would have to click multiple times for each calculation, filter the results, copy the value and paste it where I need it to be. If the data ever changes, I will have to do it all again.
What I am looking for is the equivalent of filtering in a programming language, here's an example:
let range = [1,2,3,4,0,-1,-2,-3,-4];
let subrange = range.filter(function (cell) { return cell > 0; });
subtotal(1,subrange);
So what my excel is like.
I have a column G, that has 12,000+ results in it, each one of these columns is like this:
=(En-Bn)/Bn
These are copied down, n means the row number from 5-12,000+
Now I would like to create a cell, M2 such that it contains:
=SUBTOTAL(1,[ Gn in G5:G12000 where Gn > 0 ])
The goal is that I do not want to have to point and click, because actually, there are many more cells I need to create (about 20) with similar kinds of "filter" predicates.
It would be nice, as much as possible, if I also don't have to specify the n...n-1 range of the column, as ideally that can change. Could be 10, could be 20,000, shouldn't matter.
The best formula or solution would be like:
SUBTOTAL(1, [ Gn in G0:GLENGTH where Gn > SOMECELL ])
Any pointers, or suggestions where to read, or a solution would be awesome. I've been searching on google, and it seems that I lack the right understanding to find the answer in the material presented.
Also, please excuse me for using programmer speak, I know that Excel formulas are not necessarily a 1:1, I'm just looking for a way to save time. Answers in VBA or using Macros are welcome, the main thing is to find a way to do it...
Best,
Jason
Update
I should specify that it needs to be a bit backwards compatible, so I can't use the FILTER function that is only available in >= 365
I'm not at all sure that your attempts at saving time by talking in programming language instead of English really saves either time or space. My best effort determines that you got us all confused. Please tell me why the simple formula below doesn't work.
=AVERAGEIF(G2:G15000,">"&A1,G2:G15000)
This formula requires A1 to hold a number and the formula supplies the > sign. A variation would have A1 contain both, number and comparison, like >1.2`
=AVERAGEIF(G2:G15000,A1,G2:G15000)
The above formulas start the range at G2. Change to G5 if that is what you need. G15000 is a random number intended to be larger than anything you will ever need. The function ignores blanks. However, if you are worried about having a sheet with 16000 rows just on the day you forgot where to adjust the formula I would recommend the use of a named range which you could format to be dynamic.
Named ranges are neater to handle than range addresses and names can be given descriptively, such as HourlyReadings. The above formula would then look like this:-
=AVERAGEIF(HourlyReadings, ">"&A1,HourlyReadings)
Theoretically, the formula by which HourlyReadings is defined could also be written into the worksheet formula but it would become unwieldy. As shown above, you would have to look into the Name Manager to know if the range is dynamic or not but, of course, once defined you can use the same name in many functions and formulas which saves a lot of maintenance time.
This is for Excel 365, using worksheet formulas. With data in column G starting in G5, in another cell enter:
=SUM(FILTER(G:G,G:G>0))
How about an array?
=SUM(IF(G:G>0,G:G,""))
put cursor in 'function bar' with formula. Then press CTRL+SHIFT+ENTER (in that order while holding them all down. {} will appear around formula.
Let me know if further assistance is needed.
Matt

Excel MAX/MIN but only if opposing cell is greater than 0

I've found similar examples through searching but I can't find anything that matches the issue that I have...
I have a table which shows parts received/rejected, I wish to see the maximum days early/late (I'll only need help with one as the other I can then do!)
- but there are dummy orders which I wish to ignore (they show a received/reject of 0).
Here is example data from the 'AnnualDump' sheet:
My current calculation is
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(AnnualDump!$G:$G))
[Column H is Received/Rejected and G is VarianceDays]
This simply looks at if there is any data on the sheet before running the calculation, which is fantastic for 95% of the time... but I want to ignore any values that have a received/rejected of 0...
I want it to show 29, but it's showing 30 in this instance as it's not ignoring 0qty lines.
I've tried adding another IF statement but it didn't work :/
Completely stuck now and not sure what the next step to try is...
I can do it if I cheat (call both columns to another sheet, turn text white, use an 'IF cell greater than x, then value' to compare the whole lot and then min/max that third column) but I'm trying to avoid that!
Any pointers or help will be greatly appreciated (complete VBA noob in excel so I'd like to avoid that if possible).
Thanks
Try this array formula. Confirm with Ctrl, Shift and Enter and curly brackets will appear round the formula.
I would strongly suggest you don't use full column references though as these formulae are rather resource-intensive.
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(IF(AnnualDump!$H:$H>0,AnnualDump!$G:$G)))

Counting Cells in a Range that Contains Formulas, Only when a Date is Returned?

Frequent browser, first time poster. Please go easy:
I have spent the last few days searching online, and on here for a solution to a problem I have encountered for the first time. I have a report that pulls from multiple worksheets. One column is a formula that does a VLOOKUP to another sheet and pulls back a date, if it exists. I then have a cell at the top of the sheet that calculates how many dates are pulled back out of all of the rows (to calculate % complete). This is where I am having the problem. I have tried variations of COUNTIF, COUNTA, COUNTBLANK, and so on, and formulas trying to reverse calculate,
=SUM(C4)-COUNTIF(Table3[2014 Process Date],"")
At first it appeared to work, but in this example, I had 1949 rows, and dates only populated in 7 of those rows. In theory it should return 7. Instead it is returning 237. I have done multiple filters, and manually reviewed the data in the column, and only 7 dates are there. The column has the VLOOKUP in and IFERROR nest,
=IFERROR(VLOOKUP(A12,Table_TaxData.accdb3[#All],240,FALSE),"").
I am guessing I am overlooking something silly, and was hoping someone would be able to help steer me in the right direction, or let me know what I am missing. Thanks in advance for any help!
Wow, looks like I need some more coffee! Thank you, I guess I assumed that it would be much more complicated than that. I just threw in
=COUNT(Table3[2014 Process Date])
And it worked like a charm! Thanks again!
If I'm reading your formula correctly, the target cells hold either the DATE, or a blank "".
If so, you can do a COUNTIF and do this:
=COUNT(B:B)
to get # of dates.
or
=COUNTA(B:B)-COUNT(B:B)
to get # of blanks.
(I used column B, not sure where your final values are in you're looking for - adjust accordingly)

Using a Variable in Excel for COUNTIF

First time question and I hope it's easier than I'm making this.
Can I use a variable inside a COUNTIF formula?
Currently my formula is:
=COUNTIF($C$2:$C$415,R6)
I would like to have $415 as my variable. I have tried something along the lines of:
D1=415=COUNTIF($C$2:$C$(D1),R6) ..
but obviously get a error.
The reason I need this is column C will constantly be incrementing as I add more rows.
Instead of going into each of my formulas and updated 415 to 416, 417 etc, I would like to just define a Cell that can be my variable, or total rows.
Currently Column C can have blank cells, so I can't have a macro that finds the next empty cell.. but I do however have Column A with a constant populated cell and stops at the last ticket. However Column A is unrelated to the COUNTIF.
UPDATE 1
I'd also like to mention that I'd be using this variable in many formulas in the spreadsheet. Not only COUNTIF's. Also, the COUNTIF contains text.
UPDATE 2
Actually, I figured it out! I am using this formula instead:
=COUNTIF(INDIRECT("C"&D1&":A"&D2),R6)
I'm putting D1=2 and D2=415 and will just update cell D2 with how many rows I have.
I guess I just needed to ask the question thoroughly to fully understand what I wanted!
Thank you in advance for all help, tips and suggestions.
Would "=COUNTIF($C:$C,R6)" do the trick? This will apply COUNTIF to the whole of column C. It's an easy solution, but probably not the most efficient.
I prefer tables for storing data; as new data is added, the table automatically expands and the columns are already labeled (much like Named Ranges). Then you can have =COUNTIF(Table1[Column1],"Criteria"), which will encompass any new rows added to the table automatically. Especially helpful if you have multiple tables in the same column.

Resources