Few Questions - changed

NavyJoe

Board Regular
Joined
Sep 14, 2004
Messages
63
1. I'm working on a database for awards. I have a table with a yes/no field. What I want is another field in the table to equal -1 if the yes/no field is yes. If it doesn't, then it's 0. This data will be linked to another table where a running inventory is kept. Thanks.

I've tried sum([yes/no field]), but it gives me the total sum of the database...grrrr...
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
63,302
Office Version
  1. 365
Platform
  1. Windows
Two things:

1. First, it is unnecessary. In Access Yes/No fields already have these values (Yes=-1 and No=0). To see this, simply create a calulcated field in your query where you take this field and add 0 to it (to coerce it to be displayed as a number).

2. Second, you would never want to add such a field to a table, as it violates the laws or Database Normalization, specifically that fields in a table should NOT be dependent upon other non-key fields in that table. Doing so removes the dynamic nature of the database (i.e. if you changed the value of one of these fields, the dependent value would not be updated automatically).

Any value which can be derived from other values in a table should be calculated in a query, where they will become dynamic, not stored in the table.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,991
Messages
5,834,769
Members
430,319
Latest member
Excelhelppll

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
Top