Skipping rows but not skipping reference cells

Joined
Apr 16, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi,


I want to have the formula below in every other row, but I don’t want it to skip reference numbers.


So I want:

In AK2, I have: =IFS(COUNT(AND(AC2,AD2)),AF2,COUNT(AD1),AF1)

In AK4: =IFS(COUNT(AND(AC3,AD3)),AF3,COUNT(AD2),AF2)

In AK6:= IFS(COUNT(AND(AC4,AD4)),AF4,COUNT(AD3),AF3)

In AK8: =IFS(COUNT(AND(AC5,AD5)),AF5,COUNT(AD4),AF4)


Is there a way to do this?


When I drag, it’s skipping reference cells. So in AK8, for example, it’s changing the references to AC8 and AD8.


Thank you!
 
The only things that comes to mind are either a data error in column Y, or a time in AA / AB that is in text format. (the formula relies on numbers in those columns to work correctly).

Could you try 2 test formulas and tell me the results that you get from them please.

Excel Formula:
=COUNT(AA1:AA10000)
and
Excel Formula:
=COUNT(AB1:AB10000)
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
The only things that comes to mind are either a data error in column Y, or a time in AA / AB that is in text format. (the formula relies on numbers in those columns to work correctly).

Could you try 2 test formulas and tell me the results that you get from them please.

Excel Formula:
=COUNT(AA1:AA10000)
and
Excel Formula:
=COUNT(AB1:AB10000)
Both gave me 266.
 
Upvote 0
Going over the earlier information, there was something that I missed, which is likely the cause of the incorrect results if you haven't noticed the difference.

The example that I posted with the formulas was compressed slightly, I had missed that columns Z and AA were omitted from your sample data until I was trying to understand why the 2 test formulas returned identical results. With the data in the columns that you specified in posts 6 and 7, the actual formulas would be as in the table at the end of this post.

If you haven't already made the column adjustments as mentioned above, then doing so could possibly fix the problem and make the rest of this reply redundant, for now I'm just trying to think ahead.

You say that some of the formulas are showing 0, this could only happen if there were 0 entries in the source data. The formulas are based on the assumption that there will be one row with hours in either one, or both columns (Reg and OT hours columns) with the other rows for the same name showing #N/A. If there are inconsistencies in the source data that are not shown in the example that you provided then they will likely affect the results. If this is the case, then examples of other possibilities would be needed in order to allow for them in the formula.

If a different method is going to be needed to allow for variances in the data, does the order of the result matter? Could they be listed in ID order (assuming all ID's are numeric) instead of the order of the original data?

Book1 (version 1).xlsb
AFAGAH
1IDCodeHours
21234REG34
35678REG40
45678OT2
51357REG40
61357OT15
72468REG22.25
Sheet12
Cell Formulas
RangeFormula
AF2:AF7AF2=IFERROR(INDEX(Y:Y,AGGREGATE(15,6,ROW($Y$2:$Y$17)/ISNUMBER($AC$2:$AD$17),ROWS(AF$2:AF2))),"")
AG2:AG7AG2=IF(AF2="","",IF(AF2=AF1,"OT","REG"))
AH2:AH7AH2=IF(AG2="","",SUMIFS(IF(AG2="REG",$AC$2:$AC$17,$AD$2:$AD$17),$Y$2:$Y$17,AF2,$AB$2:$AB$17,">0"))
 
Upvote 0
Solution
Going over the earlier information, there was something that I missed, which is likely the cause of the incorrect results if you haven't noticed the difference.

The example that I posted with the formulas was compressed slightly, I had missed that columns Z and AA were omitted from your sample data until I was trying to understand why the 2 test formulas returned identical results. With the data in the columns that you specified in posts 6 and 7, the actual formulas would be as in the table at the end of this post.

If you haven't already made the column adjustments as mentioned above, then doing so could possibly fix the problem and make the rest of this reply redundant, for now I'm just trying to think ahead.

You say that some of the formulas are showing 0, this could only happen if there were 0 entries in the source data. The formulas are based on the assumption that there will be one row with hours in either one, or both columns (Reg and OT hours columns) with the other rows for the same name showing #N/A. If there are inconsistencies in the source data that are not shown in the example that you provided then they will likely affect the results. If this is the case, then examples of other possibilities would be needed in order to allow for them in the formula.

If a different method is going to be needed to allow for variances in the data, does the order of the result matter? Could they be listed in ID order (assuming all ID's are numeric) instead of the order of the original data?

Book1 (version 1).xlsb
AFAGAH
1IDCodeHours
21234REG34
35678REG40
45678OT2
51357REG40
61357OT15
72468REG22.25
Sheet12
Cell Formulas
RangeFormula
AF2:AF7AF2=IFERROR(INDEX(Y:Y,AGGREGATE(15,6,ROW($Y$2:$Y$17)/ISNUMBER($AC$2:$AD$17),ROWS(AF$2:AF2))),"")
AG2:AG7AG2=IF(AF2="","",IF(AF2=AF1,"OT","REG"))
AH2:AH7AH2=IF(AG2="","",SUMIFS(IF(AG2="REG",$AC$2:$AC$17,$AD$2:$AD$17),$Y$2:$Y$17,AF2,$AB$2:$AB$17,">0"))
Thanks for your response.
I did notice the difference in the columns and already adjusted.
There's definitely data (formatted as numbers) in the hours columns. I'm not sure what the issue is or why it's looking like this (zeroes and then blank)
1618925949630.png
 
Upvote 0
I tried applying the template to another week's payroll and it worked great through line 171 but not after that. I'm not sure why they stop working in the middle.
 
Upvote 0

Forum statistics

Threads
1,214,994
Messages
6,122,633
Members
449,092
Latest member
bsb1122

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