You are here:

Excel/Conditional If formula

Advertisement


Question
Hello,

I am facing a problem. I have a excel spreadsheet which looks as;

BB          UK          1
Voice          International          1.50
Internet        UK          2.00

With 215000 rows.

I would like to know whether I can use a formula to separate the costs incurred to UK and International usage by using a formula were I can separate the costs in different columns to UK and International.Please help.

Thanks in advance.

Answer
Usman

An if formula will work perfectly and it would look like this.

Assume
your first column of data is A
the second column is B
the third column is C
so
A1 would contain BB
B1 would contain UK
C1 would contain 1

The formula you would put in cell D1 would be
=IF(B1="UK",+C1,"")

The formula you would put in cell E1 would be
=IF(B1="International",+C1,"")

As you can see if column B contains UK then the value from column C is put into column D if its not UK then the formula puts in "", or a blank.  If column B contains International then the value from column C is put into column E, if its not then a "" is put in column E.

You can put these formulas into the first two cells of the column as appropriate and then copy them down as far as you would like to.

If I understand the problem, then this should work for you.

Richard
Florida
USA  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Richard Roberts

Expertise

Can assist you in most areas of Excel, have been working with it for about 15 years in many types of applications, but primarily in financial and accounting applications. I am a CPA and many client or client problems have necessitated the use of excel. I am not an expert in charting, macros, or pivot tables.

Experience

Have been working with Excel for about 20 years primarily in accounting and financial areas.

Education/Credentials
BA, Certified Public Accountant

©2016 About.com. All rights reserved.