Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Here's my situation, I need to be able to get this sort of response:
I have a 32 bit binary word, each bit corresponds to a certain alarm. So if a certain bit in the word is 1 then that alarm is flagged, however if several bits are 1 then all the corresponding alarms are flagged. Is there some way to use some sort of lookup table which will show which alarms have been triggered? |
#2
![]() |
|||
|
|||
![]()
I don't know how you want to display the results, but using =MID(A1,x,1)
where x is 1 to 32 will return the value of that bit. You can ite this in with an IF statement to give something like =IF(MID(A1,x,1)=1,"Alarm","Noalarm"). Note that this counts from the left, so changing x to 1 will return the MSB. -- Ian -- "MadManInABox" wrote in message ... Here's my situation, I need to be able to get this sort of response: I have a 32 bit binary word, each bit corresponds to a certain alarm. So if a certain bit in the word is 1 then that alarm is flagged, however if several bits are 1 then all the corresponding alarms are flagged. Is there some way to use some sort of lookup table which will show which alarms have been triggered? |
#3
![]() |
|||
|
|||
![]()
I'm afraid you didn't notice that Madman wrote 32 bits and not bytes!
Stefi €˛Ian€¯ ezt Ć*rta: I don't know how you want to display the results, but using =MID(A1,x,1) where x is 1 to 32 will return the value of that bit. You can ite this in with an IF statement to give something like =IF(MID(A1,x,1)=1,"Alarm","Noalarm"). Note that this counts from the left, so changing x to 1 will return the MSB. -- Ian -- "MadManInABox" wrote in message ... Here's my situation, I need to be able to get this sort of response: I have a 32 bit binary word, each bit corresponds to a certain alarm. So if a certain bit in the word is 1 then that alarm is flagged, however if several bits are 1 then all the corresponding alarms are flagged. Is there some way to use some sort of lookup table which will show which alarms have been triggered? |
#4
![]() |
|||
|
|||
![]()
Put your word (integer) into cell A1, select cells B1:B28 and enter
=MOD(INT($A$1/(2^(ROW()-1))),2) with CTRL+SHIFT+ENTER (as array formula). This will work for 28 bits (highest possible number: 268,435,455). HTH, Bernd |
#5
![]() |
|||
|
|||
![]()
I tried it, but it gave zero in all cells B1:B28 for any value in A1!
What's wrong? Stefi €˛Bernd Plumhoff€¯ ezt Ć*rta: Put your word (integer) into cell A1, select cells B1:B28 and enter =MOD(INT($A$1/(2^(ROW()-1))),2) with CTRL+SHIFT+ENTER (as array formula). This will work for 28 bits (highest possible number: 268,435,455). HTH, Bernd |
#6
![]() |
|||
|
|||
![]()
"Stefi" wrote in message
... I'm afraid you didn't notice that Madman wrote 32 bits and not bytes! Stefi Yes, I did. I am assuming this 32bit binary word is a string of 32 zeros & ones, each character representing 1 bit. If this is not the case, then perhaps MadManInABox could enlighten me. -- Ian -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Recalculating a Regression Output in Data Analysis | Excel Worksheet Functions | |||
Binary Numbers longer than 10 characters | Excel Worksheet Functions | |||
Why " data analysis plus " override " data analysis " once instal. | Excel Worksheet Functions | |||
Analysis ToolPak installed but no Data Analysis option | Excel Discussion (Misc queries) |