IF Statement question with offset function. HELP Please! :)

brandonrandall

New Member
Joined
Apr 20, 2015
Messages
2
I am trying to write a function with some built in logic to process a list of data. The list of data will be sorted from smallest to largest by FREQ/Vis column. This is done with a macro. What I think I need is an "If" function with an offset embedded into it. Below is the list of data that I am trying to write a logical function for. I have color coded the number to help clarity. The black numbers at the beginning and the end will simply = the Freq/Vis and the Deg's F (corrected K factor) in the second set of columns for FREQ/Vis and DEG F. The red and green numbers represent a matched pair in which we need to take the average value between the two. The black numbers in the middle of the data do not have a match pair and for that reason we throw them out. The two columns on the far right is the calculated data (done by hand). These are the values I want to be able to get with a logical function. When it finds a matched pair, I want it to offset one row down and then rerun the logical expression.


Vis FREQ/VIS DEG F FREQ/VIS DEG F
</SPAN>1.74

<TBODY>


</TBODY><COLGROUP><COL></COLGROUP>
53.012765.1853.012765.18
1.7458.592766.9558.592766.95
1.7481.912763.1481.912763.14
0.9199.232753.40102.182755.31
1.74105.132757.22
0.91109.742751.01116.112751.91
1.74122.482752.87
1.74139.822749.25146.972746.69
0.91154.112744.13
1.74157.182747.44
1.74174.542745.30
1.74192.232744.45
0.91197.922742.14203.662742.42
1.74209.402742.69
1.74226.732741.20229.022740.06
0.91231.312738.91
1.74244.602740.95
1.74261.882740.83263.212739.57
0.91264.542738.32
0.91297.782737.98305.872738.50
1.74313.962739.01
0.91331.282737.95
0.91365.562738.12365.902737.97
1.74366.242737.83
0.91400.152738.03409.422738.10
1.74418.682738.17
0.91433.672738.27
0.91468.362738.34469.822738.32
1.74471.272738.31
0.91501.262738.71512.522738.37
1.74523.772738.04
1.74578.662737.04590.552737.72
0.91602.432738.40
1.74633.542737.67
1.74686.272737.18695.042737.50
0.91703.822737.81
1.74710.742737.62758.182737.79
0.91805.622737.97
0.91906.962737.16906.962737.16
0.911008.922736.991008.922736.99
0.911068.822737.671068.822737.67
0.911223.472737.891223.472737.89
0.911328.822737.351328.822737.35
0.911380.712738.071380.712738.07

<TBODY>
</TBODY>



Here's the my attempt at the logical statement, but it is completely wrong.

=IF(A57=A56,D56,IF(A56<>A57,AVERAGE((D56:D57)),IF(A56<>A57,OFFSET(A56,2,0,0))))


Any help would be greatly appreciated! Thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I am sorry I do not understand the links between the row and the columns and what you want to offset. Where is your formula supposed to go. Maybe you could click show formula on your sheet, take a screen shot and post it?

Anyway, you have twice the same arguments IF(A56<>A57, which makes no sense to me

We could use calculation columns as steps, so 1could be

=if(A57=A56,D56,average(D56:D57)

I want it to offset one row down and then rerun the logical expression.
Do you mean its value?
 
Upvote 0
I'm not sure how to put in a screen shot, but the two columns on the far right is where the formula would go (the numbers in blue below). As far as offsetting, maybe this is not the proper way to do it or maybe there is a better way to do it. What I want it to do is after it averages a matched pair, in the case shown below (0.91 and 1.74), I want the formula to skip the 1.74 line because the value has already been taken into consideration in the average. (This is where I was trying to skip a line or offset the equation). The formula would then pick back up and search for the next matched pair or two numbers with the same value in a row, for example 1.74 and 1.74. Values without a match pair in the middle of the data set will be thrown out, these are the black numbers seen above. This is also why you don't see any values listed in the blue calculation columns.
0.9199.232753.40102.182755.31 <--- Averages
1.74105.132757.22





<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,417
Messages
6,159,789
Members
451,589
Latest member
Harold14

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