Place Subtotal value in all cells in group - excel

I have a requirement where i need to enter the value of a SubTotal in each row for the corresponding group. Below is a snapshot of the subtotals in in Column Q and this value manualy entered by me in Column M. I'm happy to create a Macro to do this or a Formula, but i can not seem to think of the logic on how to achieve this. Can anyone advise please.
Many thanks

Put the following Array Formula in M5:
=IF(A5<>"",INDEX($Q5:$Q$1000,MATCH(0,IF($A5:$A$1000="",0,1),0)),"")
Press Ctrl-Shift-Enter instead of Enter or Tab to exit edit mode. Then copy down.

This formula worked for me:
=IF(ISBLANK(A5),"",IF(OR(ISBLANK(A4),A4="Ship-to Pt"),INDEX(Q:Q,MATCH(A5,A:A,0)+COUNTIF(A:A,A5)),M4))
Drag down the dataset.
You can set specific row limits if desired.

Related

Read value on Sheet1 from Sheet2 using vlookup

I have the following on Sheet1:
Then on Sheet2, I have data. Following is the image.
I want to read the today's and tomorrow's for all the fruits from Sheet2 to Sheet1
I tried vlookup, but it didn't give me a right answer. It was confusing. I also tried to incorporate an if statement with the vlookup, but that made it more confusing.
If you data is consistent, you can use this formula =IF(C$2="Today",INDEX(Sheet2!$D$3:$D$800,MATCH($B3,Sheet2!$B$3:$B$800,0)),INDEX(Sheet2!$D$3:$D$800,MATCH($B3,Sheet2!$B$3:$B$800,0)+1)) in cell C3. drag formula below whole table...
Maybe there is way to match with blank cells in between, but the best practice is to fill out those blanks to save your time and make the formula clean, moreover, it is very easy with this trick:
First, highlight the column (ie. B1 to B6), and then go Home > Editing > Find & Select > Go To Special > Blanks > OK, =, upper arrow key, Ctrl + Enter. This way it will fill out all the blanks with the most available text in it.
Then you can perform this easy formula to do the subtotal task:
=SUMIFS($I$3:$I$13,$G$3:$G$13,$B3,$H$3:$H$13,C$2)
Please note that I put everything in the same tab to show you how this is being done. You should change those ranges accordingly based on your data setup. This way, you can have more data and different criteria be added on and still get the correct answer as I have shown you in the above screenshot.

Duplicates and sorting

My table updated
See if this picture of my table helps understand what I am trying to do. Thank you. B1 is where I am trying to return the column C count. I do have some duplicates in column B (as mentioned with previous table).
Use this array formulas to count the uniques:
=SUM(IF(B1:B8=0.5,1/COUNTIFS(A1:A8,A1:A8,B1:B8,0.5)))
Being an array formula it must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.

Based on one input value,populate table

How can i achieve this, I want the orange table to be auto generated, based on the value in cell "F5" i.e minutes earned more than : '410'....
F5=410
I tried using index, match but couldn't achieve.Can someone help.
Put this is E8, drag over to F8, and then drag both down as far as needed.
=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($C$6:$C$21)/($C$6:$C$21>=$F$5),ROW()-7),1),"")
=IFERROR(IF(VLOOKUP($E10,$B$6:$C$21,1,FALSE)<$F$5,"",VLOOKUP($E10,$B$6:$C$21,1,FALSE)),0)
But if you want to display only the one matching the criteria within continuous rows, you'll need at least a column helper storing the row coming from MATCH.
You could add a helper-column and put:
=SMALL(IF(C:C<=$F$5,ROW(C:C)),ROW())
then push ctrl+shift+enter and drag down in column D. Then use =INDEX(B:D,D2,1) add IFERRORto avoid #errors

excel one to many look up

I would like to use a lookup formula to bring back multiple values. For example when it finds more than value in a look up I would like excel to add each value in the adjacent columns.
Can anyone help?
see attached
You can use this array formula:
=IFERROR(INDEX($B$2:$B$13,MATCH(1,($A$2:$A$13=$H$2)*(COUNTIF($H$2:H$2,$B$2:$B$13)=0),0)),"")
Being an array formula, put it in the first cell then hit Ctrl-Shift-Enter instead of enter when exiting edit mode. If done correctly then Excel will put {} around the formula.
Then copy/drag across enough columns till you get blanks.
You can also use this formula :
=IFERROR(INDEX($B$2:$B$13,SMALL(IF($H2=$A$2:$A$13,ROW($A$2:$A$13)-ROW($A$2)+1),COLUMN(A2))),"")
As this is also an array formula, press Ctrl+Shift+Enter while entering the formula.

Excel conditional that is in the same cell as an input

I am trying to work an excel spread sheet at the moment. Everything is going fine bar for this issue.
I am building a conditional statement and If I create an extra row and place this formula into it works perfectly.
=IF(G2="M","M",IF(G2="m", "M", IF(G2="d", "D", IF(G2="D","D", IF(G2="n", "N", IF(G2="N","N", "O"))))) )
What I would like to do is have the input cell and the result's output in the same cell.
Could anyone give me a quick steer in how to resolve the problem?
You can't do that as your input would overwrite the formula.
VBA is the way to to go if that's what you need.
Hide the column having the formula, and put the value of formula on next column. For example if your complex formula is on K column (let's say K2), you just need to hide K, and put following on L2:
=K2
Or, you may protect the sheet/workbook after protecting the formulas, since your idea is to hide the formulas! Just the "Format Cells" dialog, and see Protection tab. Now, you need to search on how to use it.
Use Data Validation with a DropDown and allow D,M,N,O

Resources