How to Avoid Repetitive Values when using IF formulas

itsmecassiec

New Member
Joined
Jan 11, 2017
Messages
4
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?


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

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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)
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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
Back
Top