Flagging increases in values when a certain criteria is met

MrSak87

New Member
Joined
Jan 8, 2015
Messages
44
Hi all,

I use this site often but I'm usually able to find a solution to my problem through your threads, but not this time so it's my first post.

Essentially I have huge amounts of lab data and have been automatically generating a testing schedule from it using a small macro but most calculations come from the formula bar. My problem is for a certain test a criteria must be met for it to be performed. i.e

Column A Column B Column C Column D
P100.78
P1B100.2
P1Q10.20.4
P1U10.40.6
P1B20.60.78
P211.64
P2B111.2
P2B21.21.4
P2Q11.41.64
P322.64

<tbody>
</tbody>



For every 1.5 increase (column B and C is just a start and end) I want excel in column D to write an X next to it so in the example above the "X" would appear at row "P2Q1". Normally this would be quite easy but the P1, P2, P3 show the start and end of the whole sample so whatever solution is found needs to only include subsamples P1B1,P1Q1 etc and ignore full samples P1, P2, P3.

My explanation is awful I know but hopefully you can see what I'm tying to do!! Any help would be much appreciated!
 
P100.78
P1B1B00.21
P1Q1Q0.20.4
P1U1U0.40.6
P1B2B0.60.781
P211.64
P2B1B11.21
P2B2B1.21.41
P2Q1Q1.41.64x
P322.64
P3B1B22.21x
P3Q1Q2.22.4x
P3U1U2.42.64x
P433.64
P4B1B33.21x
P4Q1Q3.23.4x
P4Q2Q3.43.64x
P544.75
P5B1B44.21x
P5U1U4.24.4
P5Q1Q4.44.6
P5B2B4.64.751x
P655.62
P6B1B55.151x
P6Q1Q5.155.35
P6B2B5.355.621x
P766.92

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
So with the above only the x's are important. They should automatically appear at 1.4-1.64, 3-3.2, 4.4-4.6 and whatever the first P7 value will be...
 
Upvote 0
Apologies, just saw your post earlier - "basically every 1.5 increase from 0 needs to be flagged somehow. so 0, 1.5, 3, 4.5 etc"
 
Upvote 0
OK, try the following

In Cell D2 enter
=IF(LEN(A2)=2,D1,(ROUNDDOWN(C2/1.5,0)*1.5))

In Cell E2 enter
=IF(D2=D1,"","X")

Copy both down full range.
 
Upvote 0
Gaz you are a genius! I've had to make a few tweaks because I needed the real values of column D, so I've just added a hidden column and copied pretty much exactly what you've done.

Thankyou!!!!!!!!!!!!!
 
Upvote 0
Just a thought, if your "whole samples" go beyond P9, you may have to tweak the formula "LEN(A2)=2" to accommodate!
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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