Avatar of maximyshka
maximyshka
 asked on

Excel Formula

How can I write using excel formula following excel functions: (it is IIf function in access)

IIf(a1=(20;32;59), "M", "C"))

a1 is a cell on excel spreadsheet which contains data.  

Please see below values on column a

20
33
56
59
32
59
95
Microsoft ExcelMicrosoft OfficeSpreadsheets

Avatar of undefined
Last Comment
Saqib Husain

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
zorvek (Kevin Jones)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Patrick Matthews

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Saqib Husain

=iif(a1=20 or a1=32 or a1=59,"M","C")
Saqib Husain

Sorry

=iif([a1]=20 or [a1]=32 or [a1]=59,"M","C")
zorvek (Kevin Jones)

Are those some kind of a VBA'ish sort of cell formulas? Pretty cool!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
harfang

> (it is IIf function in access)

For reference, the correct Access syntax would be:

=IIf(FieldA1 In (20,32,59), 'M', 'C')
(°v°)
Patrick Matthews

Markus,

I believe Saqib's example in http:#a36158546 would also be valid in Access, no?

:)

Patrick
harfang

Naturally. I was specifically referring to maximyshka's version. — (^v°)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Patrick Matthews

:)
Saqib Husain

I, myself, do not know what I was trying to do. I only remember answering that question and probably went to sleep immediately after that. I do not even remember seeing the previous responses until I woke up now.