Identify position based on voltage data

artz

Well-known Member
Joined
Aug 11, 2002
Messages
830
Office Version
  1. 2016
Platform
  1. Windows
Hi,

I am using an accelerometer to determine a patient's position on a bed. Five positions need to be identified. In the table below, corresponding accelerometer voltages were measured in each of the five positions.

Code:
Orientation	Vx	Vy	Vz
Supine flat	1.666	1.68	1.007
Supine 10˚	1.657	1.88	1.036
Prone     	1.656	1.681	2.34
Left side	1.671	1.009	1.615
Right side	1.687	2.325	1.675


Can anyone in the Forum identify the logic needed where the inputs would be Vx, Vy, and Vz and the ouput would be position?

A nested if statement would seem to be the way to do this or with VBA. Any help is greatly appreciated.

Thanks,

Art
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Will all three of the Vx, Vy, and Vz values ALWAYS EXACTLY match one of the 5 sets listed above?
Or is there every any variance that needs to be accounted for?
If there may be variance, how much is allowed?
 
Upvote 0
Hi Joe,

Thanks for your response. Unfortunately, with real world variances and tolerances would make the answer a no, these values would not be exact match matches every time. The device itself has a specification on repeatability of +/- 2% and an absolute specification of +/- 3%. After I posted, I was sort of thinking that this may more of a kind of fuzzy logic problem more than a simple if x, then y kind of problem.

Is that a scenario that Excel can work with?

Thanks,

Art
 
Upvote 0
Hi Joe,

Thanks for your response. Unfortunately, with real world variances and tolerances would make the answer a no, these values would not be exact match matches every time. The device itself has a specification on repeatability of +/- 2% and an absolute specification of +/- 3%. After I posted, I was sort of thinking that this may more of a kind of fuzzy logic problem more than a simple if x, then y kind of problem.

Is that a scenario that Excel can work with?

Thanks,

Art

Will there be a range for each of the axis values? Aslo what is the expected range output? Are you expecting the answer in a matrix format V<x, y, z> or some other format?
 
Upvote 0
I am thinking that we can probably create a User Defined Function via VBA to do this (there may be a way to do it without VBA, but it is beyond my formula writing capabilities).

So, what is your accepted variance level, +/- 2% or +/- 3%?
 
Upvote 0
Using +/- 2%, does this do it?


Excel 2010
ABCD
1OrientatonVxVyVz
2Supine flat1.6661.681.007
3Supine 10"1.6571.881.036
4Prone1.6561.6812.34
5Left side1.6711.0091.615
6Right side1.6872.3251.675
7
8Input:1.6561.891.034
9Position:Supine 10"
Sheet21
Cell Formulas
RangeFormula
B9{=INDEX(A2:A6,MATCH(1,(B2:B6<=B8*1.02)*(B2:B6>=B8*0.98)*(C2:C6<=C8*1.02)*(C2:C6>=C8*0.98)*(D2:D6<=D8*1.02)*(D2:D6>=D8*0.98),0),1)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Nice formulaic solution, kweaver!
:)
 
Upvote 0
Hi kweaver,

Thanks, works fine except one issue that Joe asked about. The data will be recorded in a matrix. It will be sampled at 1Hz (one time per second) over an 8 hour period. That's 28,800 rows of Vx, Vy, and Vz! The time will be variable; as short as an hour or less to a maximum of 8 hours.

Can your formulaic approach handle a variable record length?

Thanks,

-Art
 
Upvote 0
Art, I don't understand the matrix issue. Are you saying that there would possibly be 28,800 rows of input measurements by 3 measurements and you want to analyze EACH of them per the 1 I did?
Please explain.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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