Reputation: 11
I'm getting an error with this statement that I have too few arguments:
=IFS(AND(D8="Hourly Field",C8<24),
1,IFS(AND(D8="Hourly Field",C8>=24,C8<48),
2,IFS(AND(D8="Hourly Field",C8>=48,C8<108),
3,IF(AND(D8="Hourly Field",C8>=108),
4))
When I change from of the parentheses to square brackets, I get an error that this is not a formula:
=IFS(AND(D8="Hourly Field",C8<24),
1,IFS[AND(D8="Hourly Field",C8>=24,C8<48)],
2,IFS[AND(D8="Hourly Field",C8>=48,C8<108)],
3,IF(AND(D8="Hourly Field",C8>=108)),
4)
Can someone tell me what I'm missing?
Upvotes: 1
Views: 394
Reputation: 152605
With IFS() you do not need to nest others:
=IFS(AND(D8="Hourly Field",C8<24),1,AND(D8="Hourly Field",C8>=24,C8<48),2,AND(D8="Hourly Field",C8>=48,C8<108),3,AND(D8="Hourly Field",C8>=108),4)
Edit
Your formula can be shortened to:
=IF(D8="Hourly Field",IFS(C8<24,1,C8<48,2,C8<108,3,C8>=108,4))
Upvotes: 6