IFS FORMULA using different number ranges >=

pdiddy66

New Member
Joined
Jul 26, 2018
Messages
3
Based on formulas I found in other threads, I've tried them all unsuccessfully. Here's the last one I tried.

=
IFS(F37>=10,F37<=19,"♪",F37>=20,F37<=29,"♫",F37>=30,F37<=39,"†",F37>=40,F37<=49,"◊",F37>=50,"∆")

These are the results I need:

Years of service 10-19 =

Years of service 20-29 =
Years of service 30-39 =
Years of service 50+ =

Any help would be appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to Mr Excel forum

Create a lookup_table (gray area)


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][td="bgcolor: #DCE6F1"]
F
[/td][td="bgcolor: #DCE6F1"]
G
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Years of service​
[/td][td]
Result​
[/td][td][/td][td="bgcolor:#D9D9D9"]
Lower​
[/td][td="bgcolor:#D9D9D9"]
Higher​
[/td][td="bgcolor:#D9D9D9"]
Result​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
18​
[/td][td]
♪​
[/td][td][/td][td="bgcolor:#D9D9D9"]
10​
[/td][td="bgcolor:#D9D9D9"]
19​
[/td][td="bgcolor:#D9D9D9"]
♪​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
20​
[/td][td]
♫​
[/td][td][/td][td="bgcolor:#D9D9D9"]
20​
[/td][td="bgcolor:#D9D9D9"]
29​
[/td][td="bgcolor:#D9D9D9"]
♫​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
4​
[/td][td]
N/A​
[/td][td][/td][td="bgcolor:#D9D9D9"]
30​
[/td][td="bgcolor:#D9D9D9"]
39​
[/td][td="bgcolor:#D9D9D9"]
†​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
39​
[/td][td]
†​
[/td][td][/td][td="bgcolor:#D9D9D9"]
50​
[/td][td="bgcolor:#D9D9D9"][/td][td="bgcolor:#D9D9D9"]
∆​
[/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
53​
[/td][td]
∆​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in B2 copied down
=IFERROR(LOOKUP(A2,$D$2:$F$5),"N/A")

Hope this helps

M.
 
Upvote 0
By the way, i think the third range should be
Lower - Higher
30 - 49

Or did you forget to include the range 40 - 49?

M.
 
Upvote 0
By the way, i think the third range should be
Lower - Higher
30 - 49

Or did you forget to include the range 40 - 49?

M.

Sorry, i forgot to include the range 40-49 ;)

Try

[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][td="bgcolor: #DCE6F1"]
F
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td]
Years of service​
[/td][td]
Result​
[/td][td][/td][td="bgcolor:#D9D9D9"]
Lower​
[/td][td="bgcolor:#D9D9D9"]
Higher​
[/td][td="bgcolor:#D9D9D9"]
Result​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
18​
[/td][td]
♪​
[/td][td][/td][td="bgcolor:#D9D9D9"]
10​
[/td][td="bgcolor:#D9D9D9"]
19​
[/td][td="bgcolor:#D9D9D9"]
♪​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
20​
[/td][td]
♫​
[/td][td][/td][td="bgcolor:#D9D9D9"]
20​
[/td][td="bgcolor:#D9D9D9"]
29​
[/td][td="bgcolor:#D9D9D9"]
♫​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
4​
[/td][td]
N/A​
[/td][td][/td][td="bgcolor:#D9D9D9"]
30​
[/td][td="bgcolor:#D9D9D9"]
39​
[/td][td="bgcolor:#D9D9D9"]
†​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
40​
[/td][td]
◊​
[/td][td][/td][td="bgcolor:#D9D9D9"]
40​
[/td][td="bgcolor:#D9D9D9"]
49​
[/td][td="bgcolor:#D9D9D9"]
◊​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
53​
[/td][td]
∆​
[/td][td][/td][td="bgcolor:#D9D9D9"]
50​
[/td][td="bgcolor:#D9D9D9"][/td][td="bgcolor:#D9D9D9"]
∆​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td]
39​
[/td][td]
†​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
8
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in B2 copied down
=IFERROR(LOOKUP(A2,$D$2:$F$6),"N/A")

M.
 
Upvote 0
Sorry, i forgot to include the range 40-49 ;)

Try

[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Years of service​
[/TD]
[TD]
Result​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
Lower​
[/TD]
[TD="bgcolor: #D9D9D9"]
Higher​
[/TD]
[TD="bgcolor: #D9D9D9"]
Result​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
18​
[/TD]
[TD]
♪​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
10​
[/TD]
[TD="bgcolor: #D9D9D9"]
19​
[/TD]
[TD="bgcolor: #D9D9D9"]
♪​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
20​
[/TD]
[TD]
♫​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
20​
[/TD]
[TD="bgcolor: #D9D9D9"]
29​
[/TD]
[TD="bgcolor: #D9D9D9"]
♫​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
4​
[/TD]
[TD]
N/A​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
30​
[/TD]
[TD="bgcolor: #D9D9D9"]
39​
[/TD]
[TD="bgcolor: #D9D9D9"]
†​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD]
40​
[/TD]
[TD]
◊​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
40​
[/TD]
[TD="bgcolor: #D9D9D9"]
49​
[/TD]
[TD="bgcolor: #D9D9D9"]
◊​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD]
53​
[/TD]
[TD]
∆​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
50​
[/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"]
∆​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
39​
[/TD]
[TD]
†​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Formula in B2 copied down
=IFERROR(LOOKUP(A2,$D$2:$F$6),"N/A")

M.


This worked like a charm! Thank you so very much Marcelo. Much appreciated.
I only wasted 24 hours of my life :(
 
Upvote 0
Last question:

I want a cell to add the total number of ♪ in a range of cells... again my formula is wrong. I'm using:

=SUMIF($G$5:$G$57,"♪",♪)

I'm certain the last part the formula is incorrect.
 
Upvote 0
See if this example helps


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Years of service​
[/TD]
[TD]
Result​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
Lower​
[/TD]
[TD="bgcolor: #D9D9D9"]
Higher​
[/TD]
[TD="bgcolor: #D9D9D9"]
Result​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD="bgcolor: #FFFF00"]
18​
[/TD]
[TD]
♪​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
10​
[/TD]
[TD="bgcolor: #D9D9D9"]
19​
[/TD]
[TD="bgcolor: #D9D9D9"]
♪​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
20​
[/TD]
[TD]
♫​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
20​
[/TD]
[TD="bgcolor: #D9D9D9"]
29​
[/TD]
[TD="bgcolor: #D9D9D9"]
♫​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
4​
[/TD]
[TD]
N/A​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
30​
[/TD]
[TD="bgcolor: #D9D9D9"]
39​
[/TD]
[TD="bgcolor: #D9D9D9"]
†​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
5
[/TD]
[TD="bgcolor: #FFFF00"]
19​
[/TD]
[TD]
♪​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
40​
[/TD]
[TD="bgcolor: #D9D9D9"]
49​
[/TD]
[TD="bgcolor: #D9D9D9"]
◊​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
6
[/TD]
[TD="bgcolor: #FFFF00"]
12​
[/TD]
[TD]
♪​
[/TD]
[TD][/TD]
[TD="bgcolor: #D9D9D9"]
50​
[/TD]
[TD="bgcolor: #D9D9D9"][/TD]
[TD="bgcolor: #D9D9D9"]
∆​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
7
[/TD]
[TD]
39​
[/TD]
[TD]
†​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
8
[/TD]
[TD="bgcolor: #FFFF00"]
11​
[/TD]
[TD]
♪​
[/TD]
[TD][/TD]
[TD]
Criteria​
[/TD]
[TD]
Result​
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
9
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
♪​
[/TD]
[TD]
60​
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
10
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Criteria in D9

Formula in E9
=SUMIF($B$2:$B$8,D9,$A$2:$A$8)

M.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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