Solved

Formula Help

Posted on 2014-01-21
13
77 Views
Last Modified: 2014-10-26
Hello, trying to fix this formula, get a too many arguments error.

=IF(COUNTIF(AE6,AE39:AE41,"*Thunderstorm*")>0,9,IF(COUNTIF(AE6,AE39:AE41,"*Freezing*")>0,8,IF(COUNTIF(AE6,AE39:AE41,"*Snow*")>0,7,IF(COUNTIF(AE6,AE39:AE41,"*Blowing*")>0,6,IF(COUNTIF(AE6,AE39:AE41,"*Rain*")>0,5,IF(COUNTIF(AE6,AE39:AE41,"*Fog*")>0,4,IF(COUNTIF(AE6,AE39:AE41,"*Winds*")>0,3,1)))))))
0
Comment
Question by:sandramac
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 8

Expert Comment

by:itjockey
Comment Utility
Hi sandramac,

will you provide sample workbook pls?



thanks
0
 

Author Comment

by:sandramac
Comment Utility
Basically I need to see if the criteria such as, Thunderstorm, appears in cell AE6 or AE39 to AE 41. if so then cell equal 9, if not then continue to evaluate for the next criteria which is Freezing.
0
 
LVL 22

Expert Comment

by:Flyster
Comment Utility
The correct formula for countif is CountIf(Range, Criteria). If you remove the AE6, it will work:

=IF(COUNTIF(AE39:AE41,"*Thunderstorm*")>0,9,IF(COUNTIF(AE39:AE41,"*Freezing*")>0,8,IF(COUNTIF(AE39:AE41,"*Snow*")>0,7,IF(COUNTIF(AE39:AE41,"*Blowing*")>0,6,IF(COUNTIF(AE39:AE41,"*Rain*")>0,5,IF(COUNTIF(AE39:AE41,"*Fog*")>0,4,IF(COUNTIF(AE39:AE41,"*Winds*")>0,3,1)))))))

Flyster
0
 
LVL 8

Expert Comment

by:itjockey
Comment Utility
Do u mean this?


=IF(COUNTIF(AE39:AE41,"ThunderStrom")>0,9)
0
 
LVL 8

Expert Comment

by:itjockey
Comment Utility
=IF(COUNTIF(AE39:AE41,"Thunderstorm")>0,9,IF(COUNTIF(AE39:AE41,"Freezing")>0,8,IF(COUNTIF(AE39:AE41,"Snow")>0,7,IF(COUNTIF(AE39:AE41,"Blowing")>0,6,IF(COUNTIF(AE39:AE41,"Rain")>0,5,IF(COUNTIF(AE39:AE41,"Fog")>0,4,IF(COUNTIF(AE39:AE41,"Winds")>0,3,1)))))))
0
 
LVL 8

Expert Comment

by:itjockey
Comment Utility
oh sorry you got answer refresh IE and seen....




Thanks
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 80

Expert Comment

by:byundt
Comment Utility
If you have Excel 2007 or later, you can use the IFERROR function to return the value for no matches.

You can use LOOKUP with the reciprocal of the COUNTIF using an array of matching values to find the last matching word in the array. So by reversing the order of the tests (i.e. Thunderstorm is last), you can handle all the cases with a compact formula--and no nested IF functions.

You have to test ranges AE6 and AE39:AE41 separately, but the formula doing so is half the length of one using nested IF functions.
=MAX(IFERROR(LOOKUP(2,1/COUNTIF(AE6,"*" & {"Winds","Fog","Rain","Blowing","Snow","Freezing","Thunderstorm"} & "*"),{3,4,5,6,7,8,9}),1),IFERROR(LOOKUP(2,1/COUNTIF(AE39:AE41,"*" & {"Winds","Fog","Rain","Blowing","Snow","Freezing","Thunderstorm"} & "*"),{3,4,5,6,7,8,9}),1))

Open in new window

The above formula does not need to be array-entered.
0
 

Author Comment

by:sandramac
Comment Utility
I also need to evaluation cell AE6 to, in addition to AE39:AE41
0
 
LVL 80

Expert Comment

by:byundt
Comment Utility
I did evaluate both cells AE6 and AE39:AE41 in my suggested formula. The first IFERROR & LOOKUP handles AE6 while the second handles AE39:AE41.

I repeat the formula below with line feeds so you can see the pieces more clearly.

=MAX(
IFERROR(LOOKUP(2,1/COUNTIF(AE6,"*" & {"Winds","Fog","Rain","Blowing","Snow","Freezing","Thunderstorm"} & "*"),{3,4,5,6,7,8,9}),1),
IFERROR(LOOKUP(2,1/COUNTIF(AE39:AE41,"*" & {"Winds","Fog","Rain","Blowing","Snow","Freezing","Thunderstorm"} & "*"),{3,4,5,6,7,8,9}),1)
)
0
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
Comment Utility
Here is an explanation for the formula:
COUNTIF(AE6,"*" & {"Winds","Fog","Rain","Blowing","Snow","Freezing","Thunderstorm"}  & "*")
Returns array of counts for each possible weather condition in AE6

LOOKUP(2,1/COUNTIF(AE6,"*" ....),{3,4,5,6,7,8,9})
Returns 3, 4, 5 etc for last non-zero count in array returned by COUNTIF. Ignores errors caused by zero counts. Returns error value if there was no match for a weather condition.

IFERROR(LOOKUP(....), 1)
Returns the value returned by LOOKUP if it wasn't an error. Returns 1 if LOOKUP returned an error (no matching weather condition).

=MAX(IFERROR(LOOKUP2,1/COUNTIF(AE6,....),....),1),    IFERROR(LOOKUP2,1/COUNTIF(AE39:AE41,....),....),1))
Returns larger value from weather conditions in AE6 and AE39:AE41
WeatherReporterQ28344728.xlsx
0
 
LVL 8

Expert Comment

by:itjockey
Comment Utility
Sir byundt,
Best part of your answer is - in each and every answer  your explanation. how it comes.  Really really appreciated.


Thanks
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now