# Ensure that a re-entered number matches the original number

**URL:** <https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044>\
**Category:** Support\
**Tags:** form-design, odk-build, odk-xlsform\
**Created:** [May 23, 2024, 8:34am UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044 "2024-05-23T08:34:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joydeep\_Sarma1](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joydeep_sarma1/32/24053_2.png) [@Joydeep\_Sarma1](https://forum.getodk.org/u/Joydeep_Sarma1)\
**Post date:** [May 23, 2024, 8:34am UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/1 "2024-05-23T08:34:59Z")

</div>

TALLY Three Answer To ensure that a re-entered number matches the original number in an ODK XLSForm, using constraints similar.

1.1For example Total Number of House = 33  
Then  
2.1 Total Number of Poor house hold = 20  
2.2 Total Number of Marginal house hold = 5  
2.3 Total Number of Rich house hold = 10  
2.4 Total = 35 (total will be auto count)

As 1.1 is not matching with 2.4 so how we can make validate

---

<div class="post-metadata">

**Author:** ![joybindroo](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joybindroo/32/10263_2.png) [@joybindroo](https://forum.getodk.org/u/joybindroo)\
**Post date:** [May 23, 2024, 2:00pm UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/2 "2024-05-23T14:00:44Z")

</div>

Hi Joydeep,  
I assume 1.1 is stored as integer is variable **q1.1**  
First calculate the total no. of houses in a calculate variable **Th.**  
Then add a note **nX** before the note you create for displaying total (Th) in 2.4.  
Make **nX mandatory** and in its relevance column put this expression- **${q1.1}!=${Th}**  
This will make sure that form doesn't validate if 1.1 is not matching with 2.4.

---

<div class="post-metadata">

**Author:** ![Joydeep\_Sarma1](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joydeep_sarma1/32/24053_2.png) [@Joydeep\_Sarma1](https://forum.getodk.org/u/Joydeep_Sarma1)\
**Post date:** [May 24, 2024, 6:07am UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/3 "2024-05-24T06:07:57Z")

</div>

Its Not working please provide a excel example it will be helpful

---

<div class="post-metadata">

**Author:** ![joybindroo](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joybindroo/32/10263_2.png) [@joybindroo](https://forum.getodk.org/u/joybindroo)\
**Post date:** [May 25, 2024, 1:21am UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/4 "2024-05-25T01:21:02Z")

</div>

Can you share your XLSForm Excel?

---

<div class="post-metadata">

**Author:** ![Joydeep\_Sarma1](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joydeep_sarma1/32/24053_2.png) [@Joydeep\_Sarma1](https://forum.getodk.org/u/Joydeep_Sarma1)\
**Post date:** [May 26, 2024, 3:14pm UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/5 "2024-05-26T15:14:05Z")

</div>

[Village Profile (1).xlsx](https://forum.getodk.org/uploads/short-url/l1AF1UrhOVgyW5xbBgndMQARLjN.xlsx) (17.5 KB)

---

<div class="post-metadata">

**Author:** ![joybindroo](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/joybindroo/32/10263_2.png) [@joybindroo](https://forum.getodk.org/u/joybindroo)\
**Post date:** [May 27, 2024, 2:24pm UTC](https://forum.getodk.org/t/ensure-that-a-re-entered-number-matches-the-original-number/47044/6 "2024-05-27T14:24:28Z")

</div>

Please only make nX mandatory.
