Formula to remove empty cells

Stevetron

New Member
Joined
Jul 9, 2020
Messages
28
Office Version
  1. 365
Platform
  1. Windows
Hi,
I would like some help. I have a daily record that requires 5 data entries per day. I record the date one, then the 5 entries of data. Then repeat daily.

the problem I have is, in column A the first date is in A3, then the next date is in A8, A13 and so on.

i want a second sheet, let’s call it sheet2, to show the dates without the 4 empty cells.

for example I want sheet2A3 to show sheet1A3, sheet2A4 to show sheet1A8.

I hope this makes sense and somebody can help me. Thanks in advance
 
HI Steve,

Many thanks for providing a more detailed example. The simply answer is you haven't entered the formula correctly - I'm guessing you've forgotten the brackets around the (ROW()-3). The best way to post your spreadsheet is to use the XL2BB add in (Linked above) s that can include the actual formula's as well, without it its difficult to say exactly what has gone wrong.

Having seen your source sheet I would offer the following suggestions (the first two being from mikerickson at post #4)

1. Copy your dates down alongside all data entries.
2. Highlight the data column from cell A4 down, enter a Conditional Format (Home Ribbon), 'New Formatting Rule', 'Use a formula to determine which cells to format', enter the formula =A3=A4 and set the formatting so that the font colour is white. This will hide the 2nd-5th copies of the date.
3. On Sheet2 in cell A3 =OFFSET(Sheet1!$A$3,(ROW()-3)*5,0) and copy down.
4. On Sheet 2 in cell B3 =OFFSET(Sheet1!$M$3,(ROW()-3)*5,0) and copy down.

There are other more effective solutions, but they are quite a bit more complicated to implement - though when you have the time they're worth learning (Powerquery and PowerPivot).

HTH
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
This is sheet 2

NEW RESIN ratio record trial for graph.xlsx
AB
1
2DateDaily average
301-Jun
4 
5 
6 
7 
800-Jan
9 
10 
11 
12 
1300-Jan
14 
15 
16 
17 
1800-Jan
Sheet9
Cell Formulas
RangeFormula
A3:A18A3=IF(ISBLANK('July 2020'!A3),"",OFFSET('July 2020'!$A$3,(ROW()-3)*5,0))


this is sheet 1

NEW RESIN ratio record trial for graph.xlsx
ABCDEFGHIJKMNO
1DateCup AGross ANet ACup BGross BNet BRatioTargetUpper LimitLower LimitTemperature ©Daily AverageNotes
2   
301-Jun0.000 0.000  8.5008.7558.2450.000
40.000 0.000  8.5008.7558.245
50.000 0.000  8.5008.7558.245
60.000 0.000  8.5008.7558.245
70.000 0.000  8.5008.7558.245
802-Jun0.000 0.000  8.5008.7558.2450.000
90.000 0.000  8.5008.7558.245
100.000 0.000  8.5008.7558.245
110.000 0.000  8.5008.7558.245
120.000 0.000  8.5008.7558.245
1303-Jun0.000 0.000  8.5008.7558.2450.000
140.000 0.000  8.5008.7558.245
150.000 0.000  8.5008.7558.245
160.000 0.000  8.5008.7558.245
170.000 0.000  8.5008.7558.245
1804-Jun0.000 0.000  8.5008.7558.2450.000
190.000 0.000  8.5008.7558.245
200.000 0.000  8.5008.7558.245
210.000 0.000  8.5008.7558.245
220.000 0.000  8.5008.7558.245
2305-Jun0.000 0.000  8.5008.7558.2450.000
240.000 0.000  8.5008.7558.245
250.000 0.000  8.5008.7558.245
260.000 0.000  8.5008.7558.245
270.000 0.000  8.5008.7558.245
July 2020
Cell Formulas
RangeFormula
D2:D27,G2:G27D2=IF(C2<0.01,"",C2-B2)
H2:H27H2=IF(C2<0.01,"",IF(F2<0.01,"",D2/G2))
E3:E27,B3:B27E3=F2
N3,N23,N18,N13,N8N3=SUM(H3:H7)/5


This is how i would like sheet2 to look like

NEW RESIN ratio record trial for graph.xlsx
AB
2DateDaily average
301-Junxxx
402-Junxxx
503-Junxxx
604-Junxxx
705-Junxxx
Sheet1


Hope this helps. I have added ISBLANK to your formula, it is a habit.
 
Upvote 0
I should have added sheet1 is named July 2020, sheet2 is named sheet9
 
Upvote 0
Hi Steve,

I think you can guess why it doesn't work, and apologies for sounding annoyed, but where did I say add 'IF(ISBLANK...'? To discover why it doesn't work firstly simply use the code I offered and prove that that does work, then add back your ISBLANK and use 'Evaluate Formula' from the Formula Ribbon to discover exactly why the addition is causing the problem.

Based on the screen shot above (for which, thank you) you'll need to change the M to an N in the formula for column B.

HTH
 
Upvote 0
Hi Peter,

Thank you so very much, and i apologize, I should not have added anything to your code. Your help and responses have been excellent.

I have now input your code and both columns are working perfectly. I tried re-adding the ISBLANK and used the evaluate formula, but to no avail. I believe my knowledge is lacking too much to understand.
 
Upvote 0
OK, firstly, glad that its now working!

Lets assume you're looking at Cell A4 on Sheet2. The ISBLANK will test Cell A4 on Sheet1, which is blank, so it returns a blank and ignores the OFFSET formula, Only when it reaches cell A8 on Sheet2 does the ISBLANK return false and then try the OFFSET Formula, but that then points past your data range.

HTH
 
Upvote 0
Hi Peter,

Thank you for all your help. I understand now why the ISBLANK will not work as I input it, but undersdtanding how to get it to work is beyond me. Thank you for all your patience and assistance with this. It is very much appreciated.

I am going to start a new thread, as i would like to know about a graph that auto updates as new data is input.

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,252
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top