# How to Avoid Repetitive Values when using IF formulas

#### itsmecassiec

##### New Member
I have an excel database of survey information that returns the 1st, 2nd, and 3rd lowest values using SMALL formula, but I applied an IF formula on the spreadsheet to return the statement that value is tied to. However, if the value is the same it returns the same statement twice, rather than moving on to the next question with that value. Is there a way to avoid this?

Example of formula returning questions based on ranking:
=IF(V22=H22,\$H\$1,IF(V22=I22,\$I\$1,IF(V22=J22,\$J\$1,IF(V22=K22,\$K\$1,IF(V22=L22,\$L\$1,IF(V22=M22,\$M\$1,IF(V22=N22,\$N\$1,IF(V22= O22,\$O\$1,IF(V22=P22,\$P\$1,IF(V22=Q22,\$Q\$1,IF(V22=R22,\$R\$1,IF(V22=S22,\$S\$1,IF(V22=T22,\$T\$1,"None")))))))))))))

An example would be the first row below. The same statement appears twice because of identical values. How can I prevent this from happening?

 My fellow employees are committed to doing quality work. I have a best friend at work. In the last six months, someone at work has talked with me about my progress. In the last year, I have had opportunities to learn and grow. Rank 1st Lowest Rank 2nd Lowest Rank 3rd Lowest Lowest 2nd Lowest 3rd Lowest 3.70 3.20 3.50 3.90 3.20 3.20 3.50 At work, my opinions seem to count. At work, my opinions seem to count. In the last seven days, I have received recognition or praise for doing good work. 4.56 3.63 4.33 4.56 3.63 4.33 4.33 I have a best friend at work. My supervisor, or someone at work, seems to care about me as a person. My supervisor, or someone at work, seems to care about me as a person. 4.29 3.17 4.14 4.14 3.17 4.00 4.14 I have a best friend at work. I am satisfied with IDEA as a place to work. In the last six months, someone at work has talked with me about my progress. 4.33 3.77 88.00 4.46 3.77 4.00 4.17 I have a best friend at work. There is someone at work who encourages my development. At work, my opinions seem to count.

<tbody>
</tbody>

<tbody>
</tbody>

#### portews

##### Active Member
To get the 1st lowest, the simple SMALL formula will work, obviously, so in V22

Code:
``=SMALL(\$H22:\$T22,1)``
For the 2nd and 3rd lowest numbers it looks like (and I'm still learning this myself) and array formula will work to get the next highest unique number. In W22 put this formula and hit Shift+Ctrl+Enter to make it an array formula:
Code:
``=SMALL(IF(\$H22:\$T22>V22,\$H22:\$T22),1)``
In X22 put this formula and hit Shift+Ctrl+Enter to make it an array formula:
Code:
``=SMALL(IF(\$H22:\$T22>W22,\$H22:\$T22),2)``
You can use an offset/match to return the column header, but, if you have duplicate numbers in the row, It looks like it will be the left most match.
Where \$H\$1 is the first statement you want to return, \$H22:\$T22 is the values you're matching against and V22 is the criteria you're matching in H-T.

Code:
``=OFFSET(\$H\$1,0,MATCH(V22,\$H22:\$T22,0)-1)``

1,082,300
Messages
5,364,386
Members
400,796
Latest member
vrcdesktop

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...