Using Excel to analyze IEEE 488.2 communication status output report to determine active bits for machine operation. Want to use Excel to break down the large status decimal number to and highlight in sheet. Currently doing this manually is time consuming but works. Think Excel can do this but having a time trying to think up the formula to make it function correctly.
Project details -
16 bit register which has a decimal from 1 to 32,768. The status output of the machine gives 8,622. Manually working from bit 16 (32,768) to 1 (1) can determine that bits 14, 9, 8, 6, 4, 3, 2 are active by using the SUMIF function in Excel. =SUMIFS(E4:E35,C4:C35,"X")
What function would be used to be able to enter the status decimal and have excel subtract the closest number and indicate it is active, then subtract next closest number, etc. In this example the manual operation would be 8622 - 8192 (bit 14) = 430 - 256 (bit 9) = 174 - 128 (bit 8) = 46 - 32 (bit 6) = 14 - 8 (bit 4) = 6 - 4 (Bit 3) = 2 - 2 (Bit 2) = 0.
This might be better in a VBA code but I'm not sure how to get Excel to examine the closest number to the number being subtracted from.
Thank you for your time and any given assistance.
TS_711
Project details -
16 bit register which has a decimal from 1 to 32,768. The status output of the machine gives 8,622. Manually working from bit 16 (32,768) to 1 (1) can determine that bits 14, 9, 8, 6, 4, 3, 2 are active by using the SUMIF function in Excel. =SUMIFS(E4:E35,C4:C35,"X")
What function would be used to be able to enter the status decimal and have excel subtract the closest number and indicate it is active, then subtract next closest number, etc. In this example the manual operation would be 8622 - 8192 (bit 14) = 430 - 256 (bit 9) = 174 - 128 (bit 8) = 46 - 32 (bit 6) = 14 - 8 (bit 4) = 6 - 4 (Bit 3) = 2 - 2 (Bit 2) = 0.
This might be better in a VBA code but I'm not sure how to get Excel to examine the closest number to the number being subtracted from.
Thank you for your time and any given assistance.
TS_711